Skip to content

Commit 627a8f2

Browse files
committed
Removed non-dict event check, applied to sync
1 parent fe09138 commit 627a8f2

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,9 @@ async def process_events(self):
378378
event["event"]["module_id"] == "Balances"
379379
and event["event"]["event_id"] == "Deposit"
380380
):
381-
if isinstance(event, dict):
382-
self.__total_fee_amount += event["event"]["attributes"][
383-
"amount"
384-
]
385-
else:
386-
self.__total_fee_amount += event.value["attributes"][
387-
"amount"
388-
]
381+
self.__total_fee_amount += event["event"]["attributes"][
382+
"amount"
383+
]
389384
if possible_success is True and self.__error_message is None:
390385
# we delay the positive setting of the __is_success flag until we have finished iteration of the
391386
# events and have ensured nothing has set an error message

async_substrate_interface/sync_substrate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ def process_events(self):
331331
event["event"]["module_id"] == "Balances"
332332
and event["event"]["event_id"] == "Deposit"
333333
):
334-
self.__total_fee_amount += event.value["attributes"]["amount"]
334+
self.__total_fee_amount += event["event"]["attributes"][
335+
"amount"
336+
]
335337
if possible_success is True and self.__error_message is None:
336338
# we delay the positive setting of the __is_success flag until we have finished iteration of the
337339
# events and have ensured nothing has set an error message

0 commit comments

Comments
 (0)