mirror of https://github.com/status-im/nim-eth.git
Handle missing keys in enr.Record.get()
This commit is contained in:
parent
992aeecd29
commit
edd674662a
|
@ -101,6 +101,8 @@ proc get*[T: seq[byte] | string | SomeInteger](r: Record, key: string, typ: type
|
|||
elif typ is string:
|
||||
requireKind(f, kString)
|
||||
return f.str
|
||||
else:
|
||||
raise newException(KeyError, "Key not found in ENR: " & key)
|
||||
|
||||
proc get*(r: Record, pubKey: var PublicKey): bool =
|
||||
var pubkeyField: Field
|
||||
|
|
Loading…
Reference in New Issue