Add test for embedding custom types in tuples

This commit is contained in:
Mark Spanbroek 2021-12-02 11:15:02 +01:00
parent 46b1933aff
commit f8a226b8d6
1 changed files with 6 additions and 0 deletions

View File

@ -23,3 +23,9 @@ suite "custom types":
test "can be decoded":
let encoding = AbiEncoder.encode(custom)
check AbiDecoder.decode(encoding, CustomType) == success custom
test "can be embedded in tuples, arrays and sequences":
let embedding = (custom, [custom], @[custom])
let encoding = AbiEncoder.encode(embedding)
let decoded = AbiDecoder.decode(encoding, typeof(embedding))
check !decoded == embedding