diff --git a/python/eth_accounts_index/registry.py b/python/eth_accounts_index/registry.py index 19bfc0d..f42984e 100644 --- a/python/eth_accounts_index/registry.py +++ b/python/eth_accounts_index/registry.py @@ -72,6 +72,10 @@ class AccountRegistry: return r != 0 + def get_index(self, i): + return self.contract.functions.accounts(i).call() + + def last(self, n): c = self.count() lo = c - n - 1 diff --git a/python/eth_accounts_index/runnable/add.py b/python/eth_accounts_index/runnable/add.py index d1fbfde..d44f237 100644 --- a/python/eth_accounts_index/runnable/add.py +++ b/python/eth_accounts_index/runnable/add.py @@ -16,6 +16,7 @@ import web3 from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.keystore import DictKeystore from crypto_dev_signer.eth.helper import EthTxExecutor +from chainlib.chain import ChainSpec logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() @@ -59,8 +60,8 @@ if args.y != None: logg.debug('now have key for signer address {}'.format(signer_address)) signer = EIP155Signer(keystore) -chain_pair = args.i.split(':') -chain_id = int(chain_pair[1]) +chain_spec = ChainSpec.from_chain_str(args.i) +chain_id = chain_spec.network_id() helper = EthTxExecutor( w3, diff --git a/python/eth_accounts_index/runnable/deploy.py b/python/eth_accounts_index/runnable/deploy.py index 2e560a2..74c1231 100644 --- a/python/eth_accounts_index/runnable/deploy.py +++ b/python/eth_accounts_index/runnable/deploy.py @@ -16,6 +16,7 @@ import web3 from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.keystore import DictKeystore from crypto_dev_signer.eth.helper import EthTxExecutor +from chainlib.chain import ChainSpec logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() @@ -59,8 +60,8 @@ if args.y != None: logg.debug('now have key for signer address {}'.format(signer_address)) signer = EIP155Signer(keystore) -chain_pair = args.i.split(':') -chain_id = int(chain_pair[1]) +chain_spec = ChainSpec.from_chain_str(args.i) +chain_id = chain_spec.network_id() helper = EthTxExecutor( w3, diff --git a/python/requirements.txt b/python/requirements.txt index 1ef2087..24b729d 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,2 +1,3 @@ -confini==0.3.4 +confini~=0.3.6rc1 web3==5.12.2 +chainlib~=0.0.1a16 diff --git a/python/setup.cfg b/python/setup.cfg index abe0eb6..93356d2 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-accounts-index -version = 0.0.10a7 +version = 0.0.10a10 description = Accounts index evm contract tooling with permissioned writes author = Louis Holbrook author_email = dev@holbrook.no @@ -30,6 +30,7 @@ install_requires = confini~=0.3.6a1 web3==5.12.2 crypto-dev-signer~=0.4.13rc2 + chainlib~=0.0.1a16 tests_require = pytest==6.0.1 eth-tester==0.5.0b2