Fix missing sign flag handling, default fee in chain config

This commit is contained in:
lash 2022-05-12 09:31:07 +00:00
parent 65830cebed
commit 4d04840e3d
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 10 additions and 8 deletions

View File

@ -55,7 +55,6 @@ class ArgFlag(BaseArgFlag):
self.add('key_file') self.add('key_file')
self.add('fee') self.add('fee')
self.add('nonce') self.add('nonce')
self.add('sign')
self.add('no_target') self.add('no_target')
self.add('exec') self.add('exec')
self.add('wallet') self.add('wallet')
@ -68,10 +67,11 @@ class ArgFlag(BaseArgFlag):
self.add('fmt_rpc') self.add('fmt_rpc')
self.add('veryverbose') 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', 'no_target')
self.alias('std_base_read', 'verbose', 'config', 'raw', 'env', 'provider', 'chain_spec', 'seq') 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_read', 'std_base', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'fee', 'no_target')
self.alias('std_write', 'provider', 'chain_spec', 'unsafe', 'seq', 'key_file', 'sign', 'no_target', 'wait', 'wait_all', 'send', 'rpc_auth') 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_target', 'no_target', 'exec', 'wallet') self.alias('std_target', 'no_target', 'exec', 'wallet')
@ -91,6 +91,9 @@ class Arg(BaseArg):
self.set_long('c', 'config') self.set_long('c', 'config')
self.add_long('dumpconfig', 'config', help='Output configuration and quit. Use with --raw to omit values and output schema only.') self.add_long('dumpconfig', 'config', help='Output configuration and quit. Use with --raw to omit values and output schema only.')
self.add('a', 'wallet', dest='recipient', help='Recipient address')
self.set_long('a', 'recipient')
self.add('w', 'wait', typ=bool, help='Wait for the last transaction to be confirmed') 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') self.add('ww', 'wait', check=False, typ=bool, help='Wait for every transaction to be confirmed')
@ -116,7 +119,7 @@ class Arg(BaseArg):
self.add_long('seq', 'seq', typ=bool, help='Use sequential rpc ids') self.add_long('seq', 'seq', typ=bool, help='Use sequential rpc ids')
self.add('y', 'key_file', help='Keystore file to use for signing or address') self.add('y', 'key_file', help='Keystore file to use for signing or address')
self.set_long('y', 'key-file') self.set_long('y', 'key_file')
self.add_long('passphrase-file', 'key_file', help='Keystore file to use for signing or address') self.add_long('passphrase-file', 'key_file', help='Keystore file to use for signing or address')
self.add('s', 'send', typ=bool, help='Send to network') self.add('s', 'send', typ=bool, help='Send to network')

View File

@ -95,21 +95,18 @@ def process_config(config, arg, args, flags):
config.add(getattr(args, 'u'), '_UNSAFE') config.add(getattr(args, 'u'), '_UNSAFE')
if arg.match('sign', flags): if arg.match('sign', flags):
config.add(getattr(args, 's'), '_RPC_SEND')
if arg.match('fee', flags): if arg.match('fee', flags):
config.add(getattr(args, 'fee_price'), '_FEE_PRICE') config.add(getattr(args, 'fee_price'), '_FEE_PRICE')
fee_limit = getattr(args, 'fee_limit') fee_limit = getattr(args, 'fee_limit')
if fee_limit == None: if fee_limit == None:
fee_limit = default_fee_limit fee_limit = config.get('CHAIN_MIN_FEE')
if fee_limit == None:
fee_limit = cls.default_fee_limit
config.add(fee_limit, '_FEE_LIMIT') config.add(fee_limit, '_FEE_LIMIT')
if arg.match('nonce', flags): if arg.match('nonce', flags):
config.add(getattr(args, 'nonce'), '_NONCE') config.add(getattr(args, 'nonce'), '_NONCE')
config.add(getattr(args, 's'), '_RPC_SEND')
if args.ww: if args.ww:
config.add(True, '_WAIT_ALL') config.add(True, '_WAIT_ALL')
config.add(True, '_WAIT') config.add(True, '_WAIT')

View File

@ -10,6 +10,8 @@ proxy =
[chain] [chain]
spec = spec =
min_fee = 0
max_fee = 0
[wallet] [wallet]
key_file = key_file =