Skip to content

Commit

Permalink
use namedtuple(rename=True)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 4, 2025
1 parent a67d641 commit 926c6c3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions boa/contracts/abi/abi_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,7 @@ def decode_log(self, log_entry):

tuple_names.append(item_abi["name"])

if "from" in tuple_names:
# we can't create a namedtuple if one of the fieldnames is `from`,
# so fall back to regular tuple.
def tuple_typ(*args):
return tuple(args)

else:
tuple_typ = namedtuple(event_abi["name"], tuple_names)
tuple_typ = namedtuple(event_abi["name"], tuple_names, rename=True)

decoded_topics = []
for topic_abi, t in zip(topic_abis, topics[1:]):
Expand Down

0 comments on commit 926c6c3

Please sign in to comment.