1
0

proper handling of arg_types. add more options for listaddresses

This commit is contained in:
ThomasV
2015-05-30 18:49:58 +02:00
parent bf98b547e1
commit 92a158b910
3 changed files with 72 additions and 63 deletions

View File

@@ -181,6 +181,8 @@ def run_cmdline(config):
# arguments passed to function
args = map(lambda x: config.get(x), map(lambda x: x[0], cmd.params))
# options
args += map(lambda x: config.get(x), cmd.options)
# instanciate wallet for command-line
storage = WalletStorage(config.get_wallet_path())
@@ -297,36 +299,6 @@ def run_cmdline(config):
# See if they specificed a key on the cmd line, if not prompt
args.append(prompt_password('Enter PrivateKey (will not echo):', False))
elif cmd.name == 'createmultisig':
args = [int(args[0]), json.loads(args[1])]
elif cmd.name == 'createrawtransaction':
args = [json.loads(args[0]), json.loads(args[2])]
elif cmd.name == 'listaddresses':
args = [config.get('show_all'), config.get('show_labels')]
elif cmd.name == 'make_seed':
args = [int(config.get('nbits')), long(config.get('entropy')), config.get('language')]
elif cmd.name in ['payto', 'mktx']:
domain = [config.get('from_addr')] if config.get('from_addr') else None
args = [args[0], Decimal(args[1]), Decimal(config.get('tx_fee')) if config.get('tx_fee') else None, config.get('change_addr'), domain]
elif cmd.name in ['paytomany', 'mksendmanytx']:
domain = [config.get('from_addr')] if config.get('from_addr') else None
args = [args[0], Decimal(config.get('tx_fee')) if config.get('tx_fee') else None, config.get('change_addr'), domain]
elif cmd.name == 'help':
if len(args) < 1:
print_help(parser)
sys.exit(1)
if cmd.name == 'check_seed':
args.append(long(config.get('entropy')))
args.append(config.get('language'))
# run the command
if cmd.name == 'deseed':
if not wallet.seed: