diff --git a/eth/p2p/discoveryv5/enr.nim b/eth/p2p/discoveryv5/enr.nim index 498213c..04d996e 100644 --- a/eth/p2p/discoveryv5/enr.nim +++ b/eth/p2p/discoveryv5/enr.nim @@ -2,7 +2,8 @@ # https://github.com/ethereum/EIPs/blob/master/EIPS/eip-778.md import - net, strutils, macros, algorithm, options, + strutils, macros, algorithm, options, + stew/shims/net, nimcrypto, stew/base64, eth/[rlp, keys] @@ -117,7 +118,7 @@ template toFieldPair*(key: string, value: auto): FieldPair = proc init*(T: type Record, seqNum: uint64, pk: PrivateKey, - ip: Option[IpAddress], + ip: Option[ValidIpAddress], tcpPort, udpPort: Port, extraFields: openarray[FieldPair] = []): EnrResult[T] = diff --git a/eth/p2p/discoveryv5/protocol.nim b/eth/p2p/discoveryv5/protocol.nim index 5196cf0..f8b9792 100644 --- a/eth/p2p/discoveryv5/protocol.nim +++ b/eth/p2p/discoveryv5/protocol.nim @@ -74,7 +74,7 @@ import std/[tables, sets, options, math, random], - json_serialization/std/net, + stew/shims/net as stewNet, json_serialization/std/net, stew/[byteutils, endians2], chronicles, chronos, stint, eth/[rlp, keys], types, encoding, node, routing_table, enr @@ -691,7 +691,7 @@ proc lookupLoop(d: Protocol) {.async, raises: [Exception, Defect].} = trace "lookupLoop canceled" proc newProtocol*(privKey: PrivateKey, db: Database, - externalIp: Option[IpAddress], tcpPort, udpPort: Port, + externalIp: Option[ValidIpAddress], tcpPort, udpPort: Port, localEnrFields: openarray[FieldPair] = [], bootstrapRecords: openarray[Record] = [], bindIp = IPv4_any()):