From d7db0c16d4684e56c6bfb6c4221ac2b0eca85668 Mon Sep 17 00:00:00 2001 From: nolash Date: Tue, 16 Nov 2021 05:48:53 +0100 Subject: [PATCH] Fix same checksum problem in set cli command --- python/eth_contract_registry/runnable/list.py | 2 +- python/eth_contract_registry/runnable/set.py | 4 ++-- python/setup.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/eth_contract_registry/runnable/list.py b/python/eth_contract_registry/runnable/list.py index bb4abb3..9485dba 100644 --- a/python/eth_contract_registry/runnable/list.py +++ b/python/eth_contract_registry/runnable/list.py @@ -82,7 +82,7 @@ def main(): identifier = config.get('_IDENTIFIER') registry_address = to_checksum_address(config.get('_EXEC_ADDRESS')) - if not config.true('_UNSAFE') and registry_address != add_0x(config.get('_EXEC_ADDRESS')): + if not config.true('_UNSAFE') and strip_0x(registry_address) != strip_0x(config.get('_EXEC_ADDRESS')): raise ValueError('invalid checksum address for contract') if identifier != None: diff --git a/python/eth_contract_registry/runnable/set.py b/python/eth_contract_registry/runnable/set.py index b4dbc50..c4e0c60 100644 --- a/python/eth_contract_registry/runnable/set.py +++ b/python/eth_contract_registry/runnable/set.py @@ -63,11 +63,11 @@ def main(): c = ContractRegistry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle) subject_address = to_checksum_address(config.get('_ADDRESS')) - if not config.true('_UNSAFE') and subject_address != add_0x(config.get('_ADDRESS')): + if not config.true('_UNSAFE') and strip_0x(subject_address) != strip_0x(config.get('_ADDRESS')): raise ValueError('invalid checksum address for subject_address') registry_address = to_checksum_address(config.get('_EXEC_ADDRESS')) - if not config.true('_UNSAFE') and registry_address != add_0x(config.get('_EXEC_ADDRESS')): + if not config.true('_UNSAFE') and strip_0x(registry_address) != strip_0x(config.get('_EXEC_ADDRESS')): raise ValueError('invalid checksum address for contract') chain_config_hash = config.get('_CHAIN_HASH') diff --git a/python/setup.cfg b/python/setup.cfg index 60399dc..424cf18 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-contract-registry -version = 0.7.1 +version = 0.7.2a1 description = Ethereum Smart Contract key-value registry author = Louis Holbrook author_email = dev@holbrook.no