Skip to content

Commit

Permalink
Add collapse_if_tuple test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
davesque committed Dec 19, 2018
1 parent 80b157a commit 1ce700c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/abi-utils/test_abi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@
"type": "function",
}
FN_ABI_NO_INPUTS = {"name": "noInputs", "type": "function"}
FN_ABI_ZERO_TUPLE_INPUT = {
"inputs": [{"components": [], "type": "tuple"}],
"name": "zeroTupleInput",
"type": "function",
}
FN_ABI_SINGLETON_TUPLE_INPUT = {
"inputs": [
{"components": [{"name": "anAddress", "type": "address"}], "type": "tuple"}
],
"name": "singletonTupleInput",
"type": "function",
}
FN_ABI_ARRAY_OF_TUPLES = {
"name": "tupleArrayInput",
"type": "function",
Expand Down Expand Up @@ -112,6 +124,8 @@ def test_fn_signature_to_4byte_selector(signature, expected):
FN_ABI_FIXED_ARRAY_OF_TUPLES,
"tupleFixedArrayInput((address,uint256,bytes)[5])",
),
(FN_ABI_ZERO_TUPLE_INPUT, "zeroTupleInput(())"),
(FN_ABI_SINGLETON_TUPLE_INPUT, "singletonTupleInput((address))"),
),
)
def test__abi_to_signature(abi, expected):
Expand Down

0 comments on commit 1ce700c

Please sign in to comment.