eth-token-index

Token symbol to address unique index
Log | Files | Refs

commit 24cf85d7ead2ee315ff90b330a0f8611f18489b6
parent f1e17069610460d001d22273b4fcbc67f13763f3
Author: lash <dev@holbrook.no>
Date:   Sat, 11 Feb 2023 08:26:44 +0000

Upgrade deps, rehabilitate publish script

Diffstat:
Mpython/CHANGELOG | 6++++--
Mpython/eth_token_index/runnable/deploy.py | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
Mpython/requirements.txt | 4++--
Mpython/setup.cfg | 4++--
4 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/python/CHANGELOG b/python/CHANGELOG @@ -1,2 +1,4 @@ -* 0.2.6 - - Add writer cli tool +- 0.4.0 + * upgrade deps +- 0.2.6 + * Add writer cli tool diff --git a/python/eth_token_index/runnable/deploy.py b/python/eth_token_index/runnable/deploy.py @@ -16,6 +16,18 @@ import logging import chainlib.eth.cli from chainlib.chain import ChainSpec from chainlib.eth.tx import receipt +from chainlib.eth.cli.arg import ( + Arg, + ArgFlag, + process_args, + ) +from chainlib.eth.cli.config import ( + Config, + process_config, + ) +from chainlib.eth.cli.log import process_log +from chainlib.eth.settings import process_settings +from chainlib.settings import ChainSettings # local imports from eth_token_index import TokenUniqueSymbolIndex @@ -23,34 +35,57 @@ from eth_token_index import TokenUniqueSymbolIndex logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() -arg_flags = chainlib.eth.cli.argflag_std_write -argparser = chainlib.eth.cli.ArgumentParser(arg_flags) -args = argparser.parse_args() -config = chainlib.eth.cli.Config.from_args(args, arg_flags, default_fee_limit=TokenUniqueSymbolIndex.gas()) +arg_flags = ArgFlag() +arg = Arg(arg_flags) +flags = arg_flags.STD_WRITE -wallet = chainlib.eth.cli.Wallet() -wallet.from_config(config) +argparser = chainlib.eth.cli.ArgumentParser() +argparser = process_args(argparser, arg, flags) +args = argparser.parse_args() -rpc = chainlib.eth.cli.Rpc(wallet=wallet) -conn = rpc.connect_by_config(config) +logg = process_log(args, logg) -chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) +config = Config() +config = process_config(config, arg, args, flags) +#config = process_config_local(config, arg, args, flags) +logg.debug('config loaded:\n{}'.format(config)) +settings = ChainSettings() +settings = process_settings(settings, config) +logg.debug('settings loaded:\n{}'.format(settings)) -def main(): - signer = rpc.get_signer() - signer_address = rpc.get_sender_address() - gas_oracle = rpc.get_gas_oracle() - nonce_oracle = rpc.get_nonce_oracle() - c = TokenUniqueSymbolIndex(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle) +#arg_flags = chainlib.eth.cli.argflag_std_write +#argparser = chainlib.eth.cli.ArgumentParser(arg_flags) +#args = argparser.parse_args() +# +#config = chainlib.eth.cli.Config.from_args(args, arg_flags, default_fee_limit=TokenUniqueSymbolIndex.gas()) +# +#wallet = chainlib.eth.cli.Wallet() +#wallet.from_config(config) +# +#rpc = chainlib.eth.cli.Rpc(wallet=wallet) +#conn = rpc.connect_by_config(config) +# +#chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) - (tx_hash_hex, o) = c.constructor(signer_address) - if config.get('_RPC_SEND'): + +def main(): + conn = settings.get('CONN') + c = TokenUniqueSymbolIndex( + settings.get('CHAIN_SPEC'), + signer=settings.get('SIGNER'), + gas_oracle=settings.get('FEE_ORACLE'), + nonce_oracle=settings.get('NONCE_ORACLE'), + ) + (tx_hash_hex, o) = c.constructor( + settings.get('SENDER_ADDRESS') + ) + if settings.get('RPC_SEND'): conn.do(o) - if config.get('_WAIT'): + if config.true('_WAIT'): r = conn.wait(tx_hash_hex) if r['status'] == 0: sys.stderr.write('EVM revert while deploying contract. Wish I had more to tell you') diff --git a/python/requirements.txt b/python/requirements.txt @@ -1,3 +1,3 @@ confini~=0.6.0 -chainlib-eth>=0.1.0b1,<0.2.0 -eth_erc20~=0.3.0 +chainlib-eth~=0.4.7 +eth_erc20~=0.5.0 diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-token-index -version = 0.3.0 +version = 0.4.0 description = Token symbol to address unique index author = Louis Holbrook author_email = dev@holbrook.no @@ -40,7 +40,7 @@ testing = [options.entry_points] console_scripts = - eth-token-index-deploy = eth_token_index.runnable.deploy:main + eth-token-index-publish = eth_token_index.runnable.publish:main eth-token-index-add = eth_token_index.runnable.add:main eth-token-index-list = eth_token_index.runnable.list:main eth-token-index-writer = eth_token_index.runnable.writer:main