Upgrade chainlib

This commit is contained in:
nolash 2021-04-04 14:38:55 +02:00
parent dca45e4c47
commit c4725d8a97
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
7 changed files with 10 additions and 13 deletions

View File

@ -16,7 +16,7 @@ from chainlib.eth.constant import (
ZERO_CONTENT, ZERO_CONTENT,
MAX_UINT, MAX_UINT,
) )
from chainlib.eth.rpc import ( from chainlib.jsonrpc import (
jsonrpc_template, jsonrpc_template,
) )
from hexathon import ( from hexathon import (

View File

@ -35,7 +35,7 @@ argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed') argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed') argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string') argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing') argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
argparser.add_argument('-v', action='store_true', help='Be verbose') argparser.add_argument('-v', action='store_true', help='Be verbose')
argparser.add_argument('-vv', action='store_true', help='Be more verbose') argparser.add_argument('-vv', action='store_true', help='Be more verbose')
@ -68,7 +68,6 @@ if args.y != None:
signer = EIP155Signer(keystore) signer = EIP155Signer(keystore)
chain_spec = ChainSpec.from_chain_str(args.i) chain_spec = ChainSpec.from_chain_str(args.i)
chain_id = chain_spec.network_id()
rpc = EthHTTPConnection(args.p) rpc = EthHTTPConnection(args.p)
nonce_oracle = RPCNonceOracle(signer_address, rpc) nonce_oracle = RPCNonceOracle(signer_address, rpc)
@ -79,7 +78,7 @@ if 'ContractRegistry' not in identifiers:
logg.debug('adding identifiers {}'.format(identifiers)) logg.debug('adding identifiers {}'.format(identifiers))
def main(): def main():
c = Registry(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) c = Registry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
(tx_hash_hex, o) = c.constructor(signer_address, identifiers) (tx_hash_hex, o) = c.constructor(signer_address, identifiers)
rpc.do(o) rpc.do(o)
if block_last: if block_last:

View File

@ -37,7 +37,7 @@ default_format = 'terminal'
argparser = argparse.ArgumentParser() argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='RPC provider url (http only)') argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='RPC provider url (http only)')
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string') argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
argparser.add_argument('-r', '--registry', dest='r', required=True, type=str, help='Contract registry address') argparser.add_argument('-r', '--registry', dest='r', required=True, type=str, help='Contract registry address')
argparser.add_argument('-f', '--format', dest='f', type=str, default=default_format, help='Output format [human, brief]') argparser.add_argument('-f', '--format', dest='f', type=str, default=default_format, help='Output format [human, brief]')
argparser.add_argument('-v', action='store_true', help='Be verbose') argparser.add_argument('-v', action='store_true', help='Be verbose')
@ -52,7 +52,6 @@ elif args.v:
logg.setLevel(logging.INFO) logg.setLevel(logging.INFO)
chain_spec = ChainSpec.from_chain_str(args.i) chain_spec = ChainSpec.from_chain_str(args.i)
chain_id = chain_spec.network_id()
rpc = EthHTTPConnection(args.p) rpc = EthHTTPConnection(args.p)
registry_address = args.r registry_address = args.r
@ -89,7 +88,7 @@ def ls(ifc, fmt=default_format, w=sys.stdout):
def main(): def main():
c = Registry() c = Registry(chain_spec)
if identifier != None: if identifier != None:
element(c, identifier, fmt=fmt, w=sys.stdout) element(c, identifier, fmt=fmt, w=sys.stdout)
else: else:

View File

@ -36,7 +36,7 @@ argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)') argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed') argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed') argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string') argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing') argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
argparser.add_argument('-r', '--registry', dest='r', type=str, help='Contract registry address') argparser.add_argument('-r', '--registry', dest='r', type=str, help='Contract registry address')
argparser.add_argument('-v', action='store_true', help='Be verbose') argparser.add_argument('-v', action='store_true', help='Be verbose')
@ -71,7 +71,6 @@ if args.y != None:
signer = EIP155Signer(keystore) signer = EIP155Signer(keystore)
chain_spec = ChainSpec.from_chain_str(args.i) chain_spec = ChainSpec.from_chain_str(args.i)
chain_id = chain_spec.network_id()
rpc = EthHTTPConnection(args.p) rpc = EthHTTPConnection(args.p)
nonce_oracle = RPCNonceOracle(signer_address, rpc) nonce_oracle = RPCNonceOracle(signer_address, rpc)
@ -86,7 +85,7 @@ address = args.address
def main(): def main():
c = Registry(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id) c = Registry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
(tx_hash_hex, o) = c.set(registry_address, signer_address, identifier, address, chain_spec, ZERO_CONTENT) (tx_hash_hex, o) = c.set(registry_address, signer_address, identifier, address, chain_spec, ZERO_CONTENT)
rpc.do(o) rpc.do(o)
if block_last: if block_last:

Binary file not shown.

View File

@ -1,3 +1,3 @@
confini~=0.3.6rc3 confini~=0.3.6rc3
crypto-dev-signer~=0.4.14a9 crypto-dev-signer~=0.4.14a17
chainlib~=0.0.1a34 chainlib~=0.0.2a1

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = eth-contract-registry name = eth-contract-registry
version = 0.5.4a5 version = 0.5.4a7
description = Ethereum Smart Contract key-value registry description = Ethereum Smart Contract key-value registry
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no