add more debug details to multiaddress assertions

This commit is contained in:
Giovanni Petrantoni 2020-10-21 18:29:59 +09:00
parent 462da1f7a8
commit eeaa62feec
1 changed files with 2 additions and 2 deletions

View File

@ -855,11 +855,11 @@ proc init*(mtype: typedesc[MultiAddress],
data.write(familyProto.mcodec)
var written = familyProto.coder.stringToBuffer($address, data)
doAssert written,
"Merely writing a string to a buffer should always be possible"
"Merely writing a string to a buffer should always be possible, address: " & $address
data.write(protoProto.mcodec)
written = protoProto.coder.stringToBuffer($port, data)
doAssert written,
"Merely writing a string to a buffer should always be possible"
"Merely writing a string to a buffer should always be possible, port: " & $address
data.finish()
MultiAddress(data: data)