From 81311704756fc3a49a8813791e611ea801e283b9 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 8 Dec 2021 17:27:54 +0100 Subject: [PATCH] Support encoding of signed integers --- contractabi/encoding.nim | 20 ++++++++++++++------ tests/contractabi/testEncoding.nim | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/contractabi/encoding.nim b/contractabi/encoding.nim index d1579db..0297771 100644 --- a/contractabi/encoding.nim +++ b/contractabi/encoding.nim @@ -67,22 +67,30 @@ func encode(encoder: var AbiEncoder, tupl: Tuple) = func finishTuple(encoder: var AbiEncoder) = encoder.encode(encoder.stack.pop()) -func pad(encoder: var AbiEncoder, len: int) = +func pad(encoder: var AbiEncoder, len: int, padding=0'u8) = let padlen = (32 - len mod 32) mod 32 for _ in 0..