From 7445a23395d994503b6441a4245a8a41ee203ef4 Mon Sep 17 00:00:00 2001 From: barak manos <> Date: Tue, 30 Apr 2024 10:12:25 +0300 Subject: [PATCH] Fix issue 584 in multicaller.py --- fastlane_bot/config/multicaller.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/fastlane_bot/config/multicaller.py b/fastlane_bot/config/multicaller.py index d0f313063..9687db79c 100644 --- a/fastlane_bot/config/multicaller.py +++ b/fastlane_bot/config/multicaller.py @@ -154,18 +154,6 @@ def multicall(self) -> List[Any]: calls_for_aggregate += (_calls_for_aggregate[fn_list]) output_types_list += (_output_types_list[fn_list]) - _encoded_data = [] - - function_keys = _calls_for_aggregate.keys() - for fn_list in function_keys: - _encoded_data.append(self.web3.eth.contract( - abi=MULTICALL_ABI, - address=self.MULTICALL_CONTRACT_ADDRESS - ).functions.aggregate(_calls_for_aggregate[fn_list]).call(block_identifier=self.block_identifier)) - - if not isinstance(_encoded_data[0], list): - raise TypeError(f"Expected encoded_data to be a list, got {type(_encoded_data[0])} instead.") - encoded_data = self.web3.eth.contract( abi=MULTICALL_ABI, address=self.MULTICALL_CONTRACT_ADDRESS @@ -184,7 +172,7 @@ def multicall(self) -> List[Any]: return_data += [i[1] for i in decoded_data_list if len(i) > 1] # Handling for Bancor POL - combine results into a Tuple - if "tokenPrice" in function_keys and "amountAvailableForTrading" in function_keys: + if "tokenPrice" in _calls_for_aggregate and "amountAvailableForTrading" in _calls_for_aggregate: new_return = [] returned_items = int(len(return_data)) total_pools = int(returned_items / 2)