eth-address-index

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c282dfe9ed3f019b4e12448fc1adfa505e07f7f2
parent 67b21c369f3f9728050522898dcfa4b3c9290678
Author: nolash <dev@holbrook.no>
Date:   Fri, 19 Feb 2021 13:50:13 +0100

Import chainlib, parse chainspec

Diffstat:
Mpython/eth_address_declarator/declarator.py | 8++++----
Mpython/eth_address_declarator/runnable/add.py | 5+++--
Mpython/eth_address_declarator/runnable/deploy.py | 5+++--
Mpython/eth_token_index/runnable/add.py | 5+++--
Mpython/eth_token_index/runnable/deploy.py | 5+++--
Mpython/setup.cfg | 3++-
6 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/python/eth_address_declarator/declarator.py b/python/eth_address_declarator/declarator.py @@ -38,8 +38,8 @@ class AddressDeclarator: @staticmethod def abi(): if AddressDeclarator.__abi == None: - f = open(os.path.join(datadir, 'AccountDeclarator.json'), 'r') - AccountDeclarator.__abi = json.load(f) + f = open(os.path.join(datadir, 'AddressDeclarator.json'), 'r') + AddressDeclarator.__abi = json.load(f) f.close() return AddressDeclarator.__abi @@ -47,8 +47,8 @@ class AddressDeclarator: @staticmethod def bytecode(): if AddressDeclarator.__bytecode == None: - f = open(os.path.join(datadir, 'AccountDeclarator.bin')) - AccountDeclarator.__bytecode = f.read() + f = open(os.path.join(datadir, 'AddressDeclarator.bin')) + AddressDeclarator.__bytecode = f.read() f.close() return AddressDeclarator.__bytecode diff --git a/python/eth_address_declarator/runnable/add.py b/python/eth_address_declarator/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() @@ -60,8 +61,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_address_declarator/runnable/deploy.py b/python/eth_address_declarator/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() @@ -57,8 +58,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_token_index/runnable/add.py b/python/eth_token_index/runnable/add.py @@ -17,6 +17,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_token_index/runnable/deploy.py b/python/eth_token_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 chainspec.chain import ChainSpec logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() @@ -56,8 +57,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/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-address-index -version = 0.1.0a8 +version = 0.1.0a9 description = Signed metadata declarations for ethereum addresses author = Louis Holbrook author_email = dev@holbrook.no @@ -31,6 +31,7 @@ packages = install_requires = web3==5.12.2 crypto-dev-signer~=0.4.13rc2 + chainlib~=0.0.1a15 tests_require = eth-tester==0.5.0b2 py-evm==0.3.0a20