From 2aebae56c03cb1dd14cdf9f2fa16ca921b217ff2 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 5 Jun 2020 18:40:30 +0300 Subject: [PATCH] Don't rely on the side-effects from doAssert --- libp2p/multiaddress.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libp2p/multiaddress.nim b/libp2p/multiaddress.nim index 0b73104..60a6d35 100644 --- a/libp2p/multiaddress.nim +++ b/libp2p/multiaddress.nim @@ -834,9 +834,11 @@ proc init*(mtype: typedesc[MultiAddress], var data = initVBuffer() data.write(familyProto.mcodec) - doAssert familyProto.coder.stringToBuffer($address, data) + var written = familyProto.coder.stringToBuffer($address, data) + doAssert written, "Merely writing a string to a buffer should always be possible" data.write(protoProto.mcodec) - doAssert protoProto.coder.stringToBuffer($port, data) + written = protoProto.coder.stringToBuffer($port, data) + doAssert written, "Merely writing a string to a buffer should always be possible" data.finish() MultiAddress(data: data)