Fix nonsensical no-target handling

This commit is contained in:
lash 2022-05-12 13:21:22 +00:00
parent 4d04840e3d
commit bfed5843b4
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 11 additions and 6 deletions

View File

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

View File

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