From 4e31a86533fcb29a40d05b6e497e9165f72f5218 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 5 Jun 2020 17:10:15 +0300 Subject: [PATCH] IpAddress -> ValidIpAddress --- eth/p2p/discoveryv5/enr.nim | 5 +++-- eth/p2p/discoveryv5/protocol.nim | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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()):