@@ -909,12 +909,10 @@ def build_strict_registry() -> ABIRegistry:
909
909
return registry
910
910
911
911
912
+ # Sequence[ABIFunctionParams],
912
913
def named_tree (
913
- abi : Union [
914
- Sequence [ABIFunctionParams ],
915
- Iterable [Union [ABIFunction , ABIEvent , Dict [TypeStr , Any ]]],
916
- ],
917
- data : Tuple [Any , ...],
914
+ abi : Iterable [Union [ABIFunctionParams , ABIFunction , ABIEvent , Dict [TypeStr , Any ]]],
915
+ data : Iterable [Tuple [Any , ...]],
918
916
) -> Dict [str , Any ]:
919
917
"""
920
918
Convert function inputs/outputs or event data tuple to dict with names from ABI.
@@ -926,8 +924,7 @@ def named_tree(
926
924
927
925
928
926
def named_subtree (
929
- # TODO make this a better type
930
- abi : Any ,
927
+ abi : Union [ABIFunctionParams , ABIFunction , ABIEvent , Dict [TypeStr , Any ]],
931
928
data : Tuple [Any , ...],
932
929
) -> Union [Dict [str , Any ], Tuple [Any , ...], Any ]:
933
930
abi_type = parse (collapse_if_tuple (dict (abi )))
@@ -938,7 +935,8 @@ def named_subtree(
938
935
items = [named_subtree (item_abi , item ) for item in data ]
939
936
return items
940
937
941
- if isinstance (abi_type , TupleType ):
938
+ elif isinstance (abi_type , TupleType ):
939
+ abi = cast (ABIFunctionParams , abi )
942
940
names = [item ["name" ] for item in abi ["components" ]]
943
941
items = [named_subtree (* item ) for item in zip (abi ["components" ], data )]
944
942
0 commit comments