Skip to content

Commit

Permalink
optionals wip
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Jan 14, 2025
1 parent afcc14d commit 60a8d68
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/dipdup/runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,18 @@ def decode_event_args(
)

if isinstance(args, list):
assert 'args_name' not in event_abi
arg_names = extract_args_name(event_abi['docs'][0])
# NOTE: Old metadata
if 'args_name' not in event_abi:
arg_names = extract_args_name(event_abi['docs'][0])
# NOTE: Optionals
else:
args, unprocessed_args = [], [*args]
for arg_type in event_abi['args']:
if arg_type.startswith('option<'):
args.append(None)
else:
args.append(unprocessed_args.pop(0))

args = dict(zip(arg_names, args, strict=True))
else:
arg_names = event_abi['args_name']
Expand Down

0 comments on commit 60a8d68

Please sign in to comment.