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) data.write(familyProto.mcodec)
var written = familyProto.coder.stringToBuffer($address, data) var written = familyProto.coder.stringToBuffer($address, data)
doAssert written, 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) data.write(protoProto.mcodec)
written = protoProto.coder.stringToBuffer($port, data) written = protoProto.coder.stringToBuffer($port, data)
doAssert written, 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() data.finish()
MultiAddress(data: data) MultiAddress(data: data)