chainlib

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

commit 4d04840e3d48c79628a7a206cf0f7494252cf3bb
parent 65830cebed57747a3c3aa081db74e675b4c183a2
Author: lash <dev@holbrook.no>
Date:   Thu, 12 May 2022 09:31:07 +0000

Fix missing sign flag handling, default fee in chain config

Diffstat:
Mchainlib/cli/arg.py | 9++++++---
Mchainlib/cli/config.py | 7++-----
Mchainlib/data/config/config.ini | 2++
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/chainlib/cli/arg.py b/chainlib/cli/arg.py @@ -55,7 +55,6 @@ class ArgFlag(BaseArgFlag): self.add('key_file') self.add('fee') self.add('nonce') - self.add('sign') self.add('no_target') self.add('exec') self.add('wallet') @@ -68,10 +67,11 @@ class ArgFlag(BaseArgFlag): self.add('fmt_rpc') self.add('veryverbose') + self.alias('sign', 'key_file', 'send') 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_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') @@ -91,6 +91,9 @@ class Arg(BaseArg): 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('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('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('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('s', 'send', typ=bool, help='Send to network') diff --git a/chainlib/cli/config.py b/chainlib/cli/config.py @@ -95,21 +95,18 @@ def process_config(config, arg, args, flags): config.add(getattr(args, 'u'), '_UNSAFE') if arg.match('sign', flags): + config.add(getattr(args, 's'), '_RPC_SEND') if arg.match('fee', flags): config.add(getattr(args, 'fee_price'), '_FEE_PRICE') fee_limit = getattr(args, 'fee_limit') if fee_limit == None: - fee_limit = default_fee_limit - if fee_limit == None: - fee_limit = cls.default_fee_limit + fee_limit = config.get('CHAIN_MIN_FEE') config.add(fee_limit, '_FEE_LIMIT') if arg.match('nonce', flags): config.add(getattr(args, 'nonce'), '_NONCE') - config.add(getattr(args, 's'), '_RPC_SEND') - if args.ww: config.add(True, '_WAIT_ALL') config.add(True, '_WAIT') diff --git a/chainlib/data/config/config.ini b/chainlib/data/config/config.ini @@ -10,6 +10,8 @@ proxy = [chain] spec = +min_fee = 0 +max_fee = 0 [wallet] key_file =