Import chainlib, parse chainspec

This commit is contained in:
nolash 2021-02-19 13:50:13 +01:00
parent 67b21c369f
commit c282dfe9ed
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 18 additions and 13 deletions

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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