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