File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,15 @@ def exclude_indexed_event_inputs(event_abi: ABIEvent) -> List[ABIEventParams]:
154
154
return [arg for arg in event_abi ['inputs' ] if arg ['indexed' ] is False ]
155
155
156
156
157
+ def get_normalized_abi_arg_type (abi_arg : ABIEventParams ) -> str :
158
+ """
159
+ Return the normalized type for the abi argument provided. In order to account for tuple argument
160
+ types, this abstraction makes use of `collapse_if_tuple()` to collapse the appropriate component
161
+ types within a tuple type, if present.
162
+ """
163
+ return collapse_if_tuple (dict (abi_arg ))
164
+
165
+
157
166
def filter_by_argument_count (
158
167
num_arguments : int , contract_abi : ABI
159
168
) -> List [Union [ABIFunction , ABIEvent ]]:
Original file line number Diff line number Diff line change 39
39
to_hex ,
40
40
to_tuple ,
41
41
)
42
- from eth_utils .abi import (
43
- collapse_if_tuple ,
44
- )
45
42
from eth_utils .curried import (
46
43
apply_formatter_if ,
47
44
)
58
55
exclude_indexed_event_inputs ,
59
56
get_abi_input_names ,
60
57
get_indexed_event_inputs ,
58
+ get_normalized_abi_arg_type ,
61
59
map_abi_data ,
62
60
normalize_event_input_types ,
63
61
)
@@ -196,7 +194,7 @@ def get_event_abi_types_for_decoding(event_inputs: Sequence[ABIEventParams]) ->
196
194
if input_abi ['indexed' ] and is_dynamic_sized_type (input_abi ['type' ]):
197
195
yield 'bytes32'
198
196
else :
199
- yield collapse_if_tuple ( dict ( input_abi ) )
197
+ yield get_normalized_abi_arg_type ( input_abi )
200
198
201
199
202
200
@curry
@@ -433,9 +431,12 @@ def _build_argument_filters_from_event_abi(
433
431
key = item ['name' ]
434
432
value : 'BaseArgumentFilter'
435
433
if item ['indexed' ] is True :
436
- value = TopicArgumentFilter (abi_codec = abi_codec , arg_type = collapse_if_tuple (dict (item )))
434
+ value = TopicArgumentFilter (
435
+ abi_codec = abi_codec ,
436
+ arg_type = get_normalized_abi_arg_type (item )
437
+ )
437
438
else :
438
- value = DataArgumentFilter (arg_type = collapse_if_tuple ( dict ( item ) ))
439
+ value = DataArgumentFilter (arg_type = get_normalized_abi_arg_type ( item ))
439
440
yield key , value
440
441
441
442
You can’t perform that action at this time.
0 commit comments