help_notes('txsign'), f='\n '.join(SeedSource.format_fmt_codes().splitlines())) } } cmd_args = opts.init(opts_data) rpc_init() from mmgen.tx import * from mmgen.txsign import * seed_files = get_seed_files(opt,cmd_args) kal = get_keyaddrlist(opt) kl = get_keylist(opt) if kl and kal: kl.remove_dup_keys(kal) tx = MMGenTX(caller='txdo') tx.create(cmd_args,int(opt.locktime or 0)) if txsign(tx,seed_files,kl,kal): tx.write_to_file(ask_write=False) tx.send(exit_on_fail=True) tx.write_to_file(ask_overwrite=False,ask_write=False) if hasattr(tx,'token_addr'): msg('Contract address: {}'.format(tx.token_addr.hl())) else: die(2,'Transaction could not be signed')
tx_num_str = '' for tx_num, tx_file in enumerate(tx_files, 1): if len(tx_files) > 1: msg('\nTransaction #%s of %s:' % (tx_num, len(tx_files))) tx_num_str = ' #%s' % tx_num tx = MMGenTX(tx_file) if tx.marked_signed(): die(1, 'Transaction is already signed!') vmsg("Successfully opened transaction file '%s'" % tx_file) if opt.tx_id: msg(tx.txid) continue if opt.info or opt.terse_info: tx.view(pause=False, terse=opt.terse_info) continue if not opt.yes: tx.view_with_prompt('View data for transaction%s?' % tx_num_str) txsign(opt, c, tx, seed_files, kl, kal, tx_num_str) if not opt.yes: tx.add_comment() # edits an existing comment tx.write_to_file(ask_write=not opt.yes, ask_write_default_yes=True, add_desc=tx_num_str)
continue vmsg("Successfully opened transaction file '{}'".format(tx_file)) if opt.tx_id: msg(tx.txid) continue if opt.info or opt.terse_info: tx.view(pause=False, terse=opt.terse_info) continue if not opt.yes: tx.view_with_prompt('View data for transaction{}?'.format(tx_num_str)) if txsign(tx, seed_files, kl, kal, tx_num_str): if not opt.yes: tx.add_comment() # edits an existing comment tx.write_to_file(ask_write=not opt.yes, ask_write_default_yes=True, add_desc=tx_num_str) else: ymsg('Transaction could not be signed') bad_tx_count += 1 if bad_tx_count: ydie( 2, '{} transaction{} could not be signed'.format(bad_tx_count, suf(bad_tx_count)))
]), kg=g.key_generator, cu=g.coin), 'notes': '\n' + txcreate_notes + fee_notes.format(g.coin) + txsign_notes } cmd_args = opts.init(opts_data) if opt.aug1hf: # TODO: remove in 0.9.4 msg( yellow( 'The --aug1hf option is deprecated. Please use --coin=bch instead') ) g.coin = 'BCH' seed_files = get_seed_files(opt, cmd_args) c = rpc_connection() do_license_msg() kal = get_keyaddrlist(opt) kl = get_keylist(opt) if kl and kal: kl.remove_dup_keys(kal) tx = txcreate(cmd_args, caller='txdo') txsign(opt, c, tx, seed_files, kl, kal) tx.write_to_file(ask_write=False) if tx.send(c): tx.write_to_file(ask_overwrite=False, ask_write=False)
kal = get_keyaddrlist(opt) kl = get_keylist(opt) if kl and kal: kl.remove_dup_keys(kal) tx_num_str = '' for tx_num,tx_file in enumerate(tx_files,1): if len(tx_files) > 1: msg('\nTransaction #%s of %s:' % (tx_num,len(tx_files))) tx_num_str = ' #%s' % tx_num tx = MMGenTX(tx_file) if tx.marked_signed(): die(1,'Transaction is already signed!') vmsg("Successfully opened transaction file '%s'" % tx_file) if opt.tx_id: msg(tx.txid); continue if opt.info or opt.terse_info: tx.view(pause=False,terse=opt.terse_info); continue if not opt.yes: tx.view_with_prompt('View data for transaction%s?' % tx_num_str) txsign(tx,seed_files,kl,kal,tx_num_str) if not opt.yes: tx.add_comment() # edits an existing comment tx.write_to_file(ask_write=not opt.yes,ask_write_default_yes=True,add_desc=tx_num_str)