diff --git a/python/CHANGELOG b/python/CHANGELOG index e99ff62..aa8ceb3 100644 --- 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 index 92681fc..d7e9527 100644 --- 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) + +arg_flags = ArgFlag() +arg = Arg(arg_flags) +flags = arg_flags.STD_WRITE + +argparser = chainlib.eth.cli.ArgumentParser() +argparser = process_args(argparser, arg, flags) args = argparser.parse_args() -config = chainlib.eth.cli.Config.from_args(args, arg_flags, default_fee_limit=TokenUniqueSymbolIndex.gas()) +logg = process_log(args, logg) -wallet = chainlib.eth.cli.Wallet() -wallet.from_config(config) +config = Config() +config = process_config(config, arg, args, flags) +#config = process_config_local(config, arg, args, flags) +logg.debug('config loaded:\n{}'.format(config)) -rpc = chainlib.eth.cli.Rpc(wallet=wallet) -conn = rpc.connect_by_config(config) +settings = ChainSettings() +settings = process_settings(settings, config) +logg.debug('settings loaded:\n{}'.format(settings)) -chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) + + +#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')) 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) - - (tx_hash_hex, o) = c.constructor(signer_address) - if config.get('_RPC_SEND'): + 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 index 7d215e4..e0fb725 100644 --- 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 index bfe593f..41206c1 100644 --- 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