diff --git a/async_substrate_interface/async_substrate.py b/async_substrate_interface/async_substrate.py index 6a1de27..a654c1b 100644 --- a/async_substrate_interface/async_substrate.py +++ b/async_substrate_interface/async_substrate.py @@ -276,6 +276,7 @@ async def process_events(self): # Process other events possible_success = False for event in await self.triggered_events: + # TODO make this more readable # Check events if ( event["event"]["module_id"] == "System" @@ -378,7 +379,9 @@ async def process_events(self): event["event"]["module_id"] == "Balances" and event["event"]["event_id"] == "Deposit" ): - self.__total_fee_amount += event.value["attributes"]["amount"] + self.__total_fee_amount += event["event"]["attributes"][ + "amount" + ] if possible_success is True and self.__error_message is None: # we delay the positive setting of the __is_success flag until we have finished iteration of the # events and have ensured nothing has set an error message diff --git a/async_substrate_interface/sync_substrate.py b/async_substrate_interface/sync_substrate.py index 96d1d7f..e6a2e3b 100644 --- a/async_substrate_interface/sync_substrate.py +++ b/async_substrate_interface/sync_substrate.py @@ -237,6 +237,7 @@ def process_events(self): # Process other events possible_success = False for event in self.triggered_events: + # TODO make this more readable # Check events if ( event["event"]["module_id"] == "System" @@ -331,7 +332,9 @@ def process_events(self): event["event"]["module_id"] == "Balances" and event["event"]["event_id"] == "Deposit" ): - self.__total_fee_amount += event.value["attributes"]["amount"] + self.__total_fee_amount += event["event"]["attributes"][ + "amount" + ] if possible_success is True and self.__error_message is None: # we delay the positive setting of the __is_success flag until we have finished iteration of the # events and have ensured nothing has set an error message