From 774f5c82320cdeb8ebdd9447431a04d74a120fe0 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 13 Jun 2019 12:05:03 +0300 Subject: [PATCH] Proper fix for #18. --- libp2p/varint.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/varint.nim b/libp2p/varint.nim index 506412f7c..68e4e8308 100644 --- a/libp2p/varint.nim +++ b/libp2p/varint.nim @@ -65,7 +65,7 @@ proc getUVarint*[T: PB|LP](vtype: typedesc[T], ## byte will be decoded, all other bits will be ignored. When decoding 5th ## byte of 32bit integer only 4 bits from byte will be decoded, all other bits ## will be ignored. - ## + ## ## LibP2P ## When decoding 5th byte of 32bit integer only 4 bits from byte will be ## decoded, all other bits will be ignored. @@ -115,7 +115,7 @@ proc putUVarint*[T: PB|LP](vtype: typedesc[T], ## Google ProtoBuf ## Maximum encoded length of 64bit integer is 10 octets. ## Maximum encoded length of 32bit integer is 5 octets. - ## + ## ## LibP2P ## Maximum encoded length of 63bit integer is 9 octets. ## Maximum encoded length of 32bit integer is 5 octets. @@ -214,10 +214,10 @@ proc encodeVarint*(vtype: typedesc[PB], result.setLen(5) else: result.setLen(10) - when type(value) is SomeSVarint: + when type(value) is PBSomeSVarint: let res = putSVarint(result, outsize, value) else: - let res = putUVarint(result, outsize, value) + let res = PB.putUVarint(result, outsize, value) if res == VarintStatus.Success: result.setLen(outsize) else: