diff --git a/ape_starknet/conversion.py b/ape_starknet/conversion.py index 2216786e..b51512a2 100644 --- a/ape_starknet/conversion.py +++ b/ape_starknet/conversion.py @@ -3,7 +3,7 @@ from ape.api import ConverterAPI from ape.types import AddressType -from ape_starknet.utils import is_checksum_address, is_hex_address, to_checksum_address +from ape_starknet.utils import PLUGIN_NAME, is_checksum_address, is_hex_address, to_checksum_address # NOTE: This utility converter ensures that all bytes args can accept hex too @@ -13,7 +13,14 @@ class StarknetAddressConverter(ConverterAPI): """ def is_convertible(self, value: Any) -> bool: - return isinstance(value, str) and is_hex_address(value) and not is_checksum_address(value) + provider = self.network_manager.active_provider + return ( + provider is not None + and provider.network.ecosystem.name == PLUGIN_NAME + and isinstance(value, str) + and is_hex_address(value) + and not is_checksum_address(value) + ) def convert(self, value: str) -> AddressType: """