mirror of
https://github.com/logos-storage/nim-contract-abi.git
synced 2026-01-05 23:23:13 +00:00
Add test for embedding custom types in tuples
This commit is contained in:
parent
46b1933aff
commit
f8a226b8d6
@ -23,3 +23,9 @@ suite "custom types":
|
|||||||
test "can be decoded":
|
test "can be decoded":
|
||||||
let encoding = AbiEncoder.encode(custom)
|
let encoding = AbiEncoder.encode(custom)
|
||||||
check AbiDecoder.decode(encoding, CustomType) == success 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user