Skip to content

Commit 8bd60d3

Browse files
feuGeneAdavesque
authored andcommitted
Update get_abi_*_types functions to handle tuples
1 parent c4de474 commit 8bd60d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web3/_utils/abi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
to_text,
2424
to_tuple,
2525
)
26+
from eth_utils.abi import (
27+
collapse_if_tuple,
28+
)
2629

2730
from web3._utils.ens import (
2831
is_ens_name,
@@ -60,14 +63,14 @@ def get_abi_input_types(abi):
6063
if 'inputs' not in abi and abi['type'] == 'fallback':
6164
return []
6265
else:
63-
return [arg['type'] for arg in abi['inputs']]
66+
return [collapse_if_tuple(arg) for arg in abi['inputs']]
6467

6568

6669
def get_abi_output_types(abi):
6770
if abi['type'] == 'fallback':
6871
return []
6972
else:
70-
return [arg['type'] for arg in abi['outputs']]
73+
return [collapse_if_tuple(arg) for arg in abi['outputs']]
7174

7275

7376
def get_abi_input_names(abi):

0 commit comments

Comments
 (0)