From dd101f52b1b3acf94aba052aabc8d816a630c07c Mon Sep 17 00:00:00 2001 From: yongchand Date: Wed, 25 Jan 2023 11:32:49 +0900 Subject: [PATCH] Handle BadFunctionCallOutput error while detecting interface --- klaytnetl/service/klaytn_contract_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klaytnetl/service/klaytn_contract_service.py b/klaytnetl/service/klaytn_contract_service.py index 1bca146..a81034f 100644 --- a/klaytnetl/service/klaytn_contract_service.py +++ b/klaytnetl/service/klaytn_contract_service.py @@ -23,7 +23,7 @@ from eth_utils import function_signature_to_4byte_selector -from web3.exceptions import ContractLogicError +from web3.exceptions import BadFunctionCallOutput, ContractLogicError from ethereum_dasm.evmdasm import EvmCode, Contract from klaytnetl.erc165_abi import ERC165_ABI @@ -73,7 +73,7 @@ def contract_interface_support(self, contract_address, block_number, interface): try: contract_interface_support = contract_165.functions.supportsInterface(interface) \ .call(block_identifier=block_number) - except ContractLogicError: + except (BadFunctionCallOutput, ContractLogicError) : contract_interface_support = False return contract_interface_support