From f8a226b8d6aba2ebbc6802a839edb2d467665c8e Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Thu, 2 Dec 2021 11:15:02 +0100 Subject: [PATCH] Add test for embedding custom types in tuples --- tests/contractabi/testCustomTypes.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/contractabi/testCustomTypes.nim b/tests/contractabi/testCustomTypes.nim index 9966da6..13ae90d 100644 --- a/tests/contractabi/testCustomTypes.nim +++ b/tests/contractabi/testCustomTypes.nim @@ -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