Skip to content

Commit fe09138

Browse files
committed
add type checking
1 parent 933084c commit fe09138

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,14 @@ async def process_events(self):
378378
event["event"]["module_id"] == "Balances"
379379
and event["event"]["event_id"] == "Deposit"
380380
):
381-
self.__total_fee_amount += event.value["attributes"]["amount"]
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+
]
382389
if possible_success is True and self.__error_message is None:
383390
# we delay the positive setting of the __is_success flag until we have finished iteration of the
384391
# events and have ensured nothing has set an error message

0 commit comments

Comments
 (0)