chainlib

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

commit 27c2b5f90f054a720ac70199cc2a345c24fd9f90
parent e1c4f1edd9ad0e6d725af3e25a66213900d1da7e
Author: lash <dev@holbrook.no>
Date:   Thu,  3 Nov 2022 18:21:11 +0000

Add 'total' arg, config

Diffstat:
Mchainlib/cli/arg.py | 3+++
Mchainlib/cli/config.py | 3+++
Mchainlib/settings.py | 1+
3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/chainlib/cli/arg.py b/chainlib/cli/arg.py @@ -76,6 +76,7 @@ class ArgFlag(BaseArgFlag): self.add('veryverbose') self.add('path') self.add('backend') + self.add('value') self.alias('sign', 'key_file', 'send') self.alias('std_base', 'verbose', 'config', 'raw', 'env', 'target') @@ -146,6 +147,8 @@ class Arg(BaseArg): self.add_long('fee-price', 'fee', typ=int, help='override fee price') self.add_long('fee-limit', 'fee', typ=int, help='override fee limit') + self.add_long('total', 'value', typ=bool, help='Deduct calculated fee from value') + self.add_long('state-path', 'path', help='Path to store state data under') self.add_long('runtime-path', 'path', help='Path to store volatile data under') self.add_long('backend', 'backend', help='Backend to use for data storage') diff --git a/chainlib/cli/config.py b/chainlib/cli/config.py @@ -123,6 +123,9 @@ def process_config(config, arg, args, flags): if arg.match('wallet', flags): config.add(getattr(args, 'recipient'), '_RECIPIENT') + if arg.match('value', flags): + config.add(getattr(args, 'total'), '_TOTAL') + if arg.match('exec', flags): config.add(getattr(args, 'executable_address'), '_EXEC_ADDRESS') diff --git a/chainlib/settings.py b/chainlib/settings.py @@ -39,6 +39,7 @@ def process_settings_value(settings, config): return settings value = postfix_to_int(config.get('_VALUE')) + settings.set('VALUE', value) return settings