properly parse multiaddress

This commit is contained in:
Jaremy Creechley 2023-06-22 16:32:01 -07:00
parent 5f0e581bc7
commit a480e3b8f8
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -309,6 +309,16 @@ proc readValue*(r: var TomlReader, val: var SignedPeerRecord) =
val = SignedPeerRecord.parseCmdArg(uri)
proc readValue*(r: var TomlReader, val: var MultiAddress) =
without maddr =? r.readValue(string).catch, err:
error "invalid MultiAddress value", error = err.msg
quit QuitFailure
without val =? MultiAddress.init(maddr).catch, err:
error "invalid MultiAddress value", error = err.msg
quit QuitFailure
# no idea why confutils needs this:
proc completeCmdArg*(T: type EthAddress; val: string): seq[string] =
discard