19 Commits

Author SHA1 Message Date
Mark Spanbroek
01c11eecb0 Custom encoding can use startTuple() and finishTuple() 2022-04-13 06:48:23 +02:00
Mark Spanbroek
e3c9aa4368 Add support for Ethereum addresses 2022-01-19 09:16:22 +01:00
Mark Spanbroek
971cdad25d Simplify encoding/decoding of signed integers
Fixes error in Nim 1.4.8
2021-12-09 11:48:14 +01:00
Mark Spanbroek
a0fad53523 Support decoding of signed integers 2021-12-09 10:38:34 +01:00
Mark Spanbroek
d0b1c1d9b0 Reorder decoding funcs
Now all decode overloads are in one place
2021-12-02 11:21:06 +01:00
Mark Spanbroek
46b1933aff Decoder: tuples do not have an offset, their elements do
No longer read offset when starting dynamic tuple,
read it when reading a dynamic element in a tuple.

Remove Tuple.dynamic, because it's no longer needed.
2021-12-02 11:13:50 +01:00
Mark Spanbroek
f40101100e Support encoding and decoding of custom types 2021-12-01 17:44:46 +01:00
Mark Spanbroek
987d6f4028 Fail gracefully when decoding enum fails 2021-12-01 17:26:35 +01:00
Mark Spanbroek
f1d85a6d84 Fail gracefully when decoding range fails 2021-12-01 17:26:05 +01:00
Mark Spanbroek
51da2802aa Decoding fails gracefully in several error cases 2021-12-01 16:34:02 +01:00
Mark Spanbroek
a43c7b21a4 Add support for decode failures by returning Result type 2021-12-01 13:01:28 +01:00
Mark Spanbroek
319418cab7 Remove procs from public API
Since the introduction of the new API for encoding
and decoding of tuples, these procs are no longer
required to be on the external API.
2021-12-01 12:09:42 +01:00
Mark Spanbroek
2aa8685eb5 Simplify decoding of tuples 2021-12-01 11:40:12 +01:00
Mark Spanbroek
ead71d7f87 Work around overload resolution bug in Nim 1.2.14 2021-12-01 11:18:41 +01:00
Mark Spanbroek
78b87cd138 Move index field from AbiDecoder into Tuple
Fixes faiing decoding test.
2021-12-01 10:59:31 +01:00
Mark Spanbroek
3015760b3e Use similar terminology when encoding and decoding
For writing custom decoding functions, `decode` and `read`
now work the same as `encode` and `write for encoding.
2021-11-30 16:52:23 +01:00
Mark Spanbroek
4126edf89f Decode strings 2021-11-30 16:35:38 +01:00
Mark Spanbroek
0f4c4d1465 Decode sequences and arrays 2021-11-30 16:22:52 +01:00
Mark Spanbroek
767c4ab588 Decoding of basic types 2021-11-30 15:14:57 +01:00