@Test public void fromDiscoveryPeer_shouldConvertIpV6Peer() throws Exception { final byte[] ipAddress = Bytes.fromHexString("0x33000004500007800000001200000001").toArray(); final int port = 5883; final DiscoveryPeer peer = new DiscoveryPeer( PUB_KEY, new InetSocketAddress(InetAddress.getByAddress(ipAddress), port), ENR_FORK_ID, PERSISTENT_SUBNETS); final Multiaddr result = MultiaddrUtil.fromDiscoveryPeer(peer); assertThat(result) .isEqualTo(Multiaddr.fromString("/ip6/3300:4:5000:780:0:12:0:1/tcp/5883/p2p/" + PEER_ID)); assertThat(result.getComponent(Protocol.IP6)).isEqualTo(ipAddress); assertThat(result.getComponent(Protocol.TCP)).isEqualTo(Protocol.TCP.addressToBytes("5883")); assertThat(result.getComponent(Protocol.P2P)).isEqualTo(NODE_ID.toBytes().toArrayUnsafe()); }
public static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer) { return fromInetSocketAddress(peer.getNodeAddress(), getNodeId(peer)); }
MultiaddrUtil { public static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer) { return fromInetSocketAddress(peer.getNodeAddress(), getNodeId(peer)); } }
MultiaddrUtil { public static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer) { return fromInetSocketAddress(peer.getNodeAddress(), getNodeId(peer)); }  }
MultiaddrUtil { public static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer) { return fromInetSocketAddress(peer.getNodeAddress(), getNodeId(peer)); }  static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer); static Multiaddr fromDiscoveryPeerAsUdp(final DiscoveryPeer peer); static Multiaddr fromInetSocketAddress(
      final InetSocketAddress address, final NodeId nodeId); }
MultiaddrUtil { public static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer) { return fromInetSocketAddress(peer.getNodeAddress(), getNodeId(peer)); }  static Multiaddr fromDiscoveryPeer(final DiscoveryPeer peer); static Multiaddr fromDiscoveryPeerAsUdp(final DiscoveryPeer peer); static Multiaddr fromInetSocketAddress(
      final InetSocketAddress address, final NodeId nodeId);  }