Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

The multiaddrToSocketAddress function uses multiaddr.bytes solely for its getter side-effect (cache population). This pattern is flagged by Biome as an unused expression.

Changes:

  • Replace multiaddr.bytes; with void multiaddr.bytes in packages/discv5/src/util/ip.ts
  • Update comment to clarify intent
export function multiaddrToSocketAddress(multiaddr: Multiaddr): SocketAddress {
  let ip: Ip | undefined;
  let port: number | undefined;
  // Force cache population of bytes property to ensure getComponents() works correctly
  void multiaddr.bytes;
  for (const component of multiaddr.getComponents()) {
    // ...
  }
}

This pattern is consistent with the approach used in packages/enr/src/enr.ts.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: wemeetagain <1348242+wemeetagain@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on dependency refresh implementation Use explicit void operator for side-effect expression in multiaddr conversion Feb 9, 2026
@wemeetagain wemeetagain marked this pull request as ready for review February 9, 2026 22:22
@wemeetagain wemeetagain requested a review from a team as a code owner February 9, 2026 22:22
Copilot AI requested a review from wemeetagain February 9, 2026 22:22
@wemeetagain wemeetagain merged commit 2830f81 into cayman/refresh Feb 9, 2026
@wemeetagain wemeetagain deleted the copilot/sub-pr-324 branch February 9, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants