IpAddress -> ValidIpAddress

This commit is contained in:
Zahary Karadjov 2020-06-05 17:10:15 +03:00
parent 5243c9cf18
commit 4e31a86533
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
2 changed files with 5 additions and 4 deletions

View File

@ -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] =

View File

@ -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()):