chainlib

Generic blockchain access library and tooling
Log | Files | Refs | README | LICENSE

commit bfed5843b4573eace1fb8213d0f0c460e10f27f1
parent 4d04840e3d48c79628a7a206cf0f7494252cf3bb
Author: lash <dev@holbrook.no>
Date:   Thu, 12 May 2022 13:21:22 +0000

Fix nonsensical no-target handling

Diffstat:
Mchainlib/cli/arg.py | 13+++++++++----
Mchainlib/cli/config.py | 4++--
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/chainlib/cli/arg.py b/chainlib/cli/arg.py @@ -50,6 +50,7 @@ class ArgFlag(BaseArgFlag): self.add('env') self.add('provider') self.add('chain_spec') + self.add('target') self.add('unsafe') self.add('seq') self.add('key_file') @@ -68,10 +69,10 @@ class ArgFlag(BaseArgFlag): self.add('veryverbose') self.alias('sign', 'key_file', 'send') - self.alias('std_base', 'verbose', 'config', 'raw', 'env', 'no_target') + self.alias('std_base', 'verbose', 'config', 'raw', 'env', 'target') self.alias('std_base_read', 'verbose', 'config', 'raw', 'env', 'provider', 'chain_spec', 'seq') - self.alias('std_read', 'std_base', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'fee', 'no_target') - self.alias('std_write', 'verbose', 'config', 'raw', 'env', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'sign', 'no_target', 'wait', 'wait_all', 'send', 'rpc_auth', 'nonce', 'fee') + self.alias('std_read', 'std_base', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'fee', 'target') + self.alias('std_write', 'verbose', 'config', 'raw', 'env', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'sign', 'target', 'wait', 'wait_all', 'send', 'rpc_auth', 'nonce', 'fee') self.alias('std_target', 'no_target', 'exec', 'wallet') @@ -94,6 +95,9 @@ class Arg(BaseArg): self.add('a', 'wallet', dest='recipient', help='Recipient address') self.set_long('a', 'recipient') + self.add('e', 'exec', dest='executable_address', help='Recipient address') + self.set_long('e', 'executable') + self.add('w', 'wait', typ=bool, help='Wait for the last transaction to be confirmed') self.add('ww', 'wait', check=False, typ=bool, help='Wait for every transaction to be confirmed') @@ -105,7 +109,8 @@ class Arg(BaseArg): self.add_long('rpc-timeout', 'provider', help='RPC autentication credential values') self.add_long('rpc-proxy', 'provider', help='RPC autentication credential values') - self.add_long('height', 'no_target', default='latest', help='Block height to execute against') + #self.add_long('height', 'no_target', default='latest', help='Block height to execute against') + self.add_long('height', 'target', default='latest', help='Block height to execute against') self.add_long('rpc-auth', 'rpc_auth', help='RPC autentication scheme') self.add_long('rpc-credentials', 'rpc_auth', help='RPC autentication credential values') diff --git a/chainlib/cli/config.py b/chainlib/cli/config.py @@ -88,7 +88,7 @@ def process_config(config, arg, args, flags): config.dict_override(args_override, 'cli args', allow_empty=True) if arg.match('provider', flags): - if arg.match('no_target', flags, negate=True): + if arg.match('target', flags): config.add(getattr(args, 'height'), '_HEIGHT') if arg.match('unsafe', flags): @@ -101,7 +101,7 @@ def process_config(config, arg, args, flags): config.add(getattr(args, 'fee_price'), '_FEE_PRICE') fee_limit = getattr(args, 'fee_limit') if fee_limit == None: - fee_limit = config.get('CHAIN_MIN_FEE') + fee_limit = int(config.get('CHAIN_MIN_FEE')) config.add(fee_limit, '_FEE_LIMIT') if arg.match('nonce', flags):