From c15c97a95e1c25c362a982bd9376d6f80636de37 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 26 Nov 2022 18:55:54 +0000 Subject: [PATCH] option rename: --tx-confs -> --fee-estimate-confs This change breaks compatibility. Scripts may need to be adjusted. --- mmgen/globalvars.py | 4 ++-- mmgen/main_txcreate.py | 4 ++-- mmgen/main_txdo.py | 4 ++-- mmgen/proto/btc/daemon.py | 4 ++-- mmgen/proto/btc/tx/new.py | 4 ++-- mmgen/tx/new.py | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index dc1549d9..dd476e11 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -68,7 +68,7 @@ class GlobalContext(Lockable): usr_randchars = 30 tx_fee_adj = 1.0 - tx_confs = 3 + fee_estimate_confs = 3 # Constant vars - some of these might be overridden in opts.py, but they don't change thereafter @@ -154,7 +154,7 @@ class GlobalContext(Lockable): 'debug', 'minconf', 'quiet', - 'tx_confs', + 'fee_estimate_confs', 'tx_fee_adj', 'use_internal_keccak_module', 'usr_randchars' ) diff --git a/mmgen/main_txcreate.py b/mmgen/main_txcreate.py index 3e801860..5a5850b7 100755 --- a/mmgen/main_txcreate.py +++ b/mmgen/main_txcreate.py @@ -34,8 +34,8 @@ opts_data = { -a, --tx-fee-adj= f Adjust transaction fee by factor 'f' (see below) -B, --no-blank Don't blank screen before displaying unspent outputs -c, --comment-file=f Source the transaction's comment from file 'f' --C, --tx-confs= c Desired number of confirmations for fee estimation - (default: {g.tx_confs}) +-C, --fee-estimate-confs=c Desired number of confirmations for fee estimation + (default: {g.fee_estimate_confs}) -d, --outdir= d Specify an alternate directory 'd' for output -D, --contract-data=D Path to hex-encoded contract data (ETH only) -E, --fee-estimate-mode=M Specify the network fee estimate mode. Choices: diff --git a/mmgen/main_txdo.py b/mmgen/main_txdo.py index ec827b9f..513033a8 100755 --- a/mmgen/main_txdo.py +++ b/mmgen/main_txdo.py @@ -37,8 +37,8 @@ opts_data = { brainwallet input -B, --no-blank Don't blank screen before displaying unspent outputs -c, --comment-file= f Source the transaction's comment from file 'f' --C, --tx-confs= c Desired number of confirmations for fee estimation - (default: {g.tx_confs}) +-C, --fee-estimate-confs=c Desired number of confirmations for fee estimation + (default: {g.fee_estimate_confs}) -d, --outdir= d Specify an alternate directory 'd' for output -D, --contract-data= D Path to hex-encoded contract data (ETH only) -e, --echo-passphrase Print passphrase to screen when typing it diff --git a/mmgen/proto/btc/daemon.py b/mmgen/proto/btc/daemon.py index 0f4bf1e0..179a65ee 100755 --- a/mmgen/proto/btc/daemon.py +++ b/mmgen/proto/btc/daemon.py @@ -120,7 +120,7 @@ class bitcoin_core_daemon(CoinDaemon): return ('importaddress',coinaddr,lbl,False) def estimatefee_args(self,rpc): - return (opt.tx_confs,) + return (opt.fee_estimate_confs,) def sigfail_errmsg(self,e): return e.args[0] @@ -143,7 +143,7 @@ class bitcoin_cash_node_daemon(bitcoin_core_daemon): return ('importaddress',coinaddr,lbl,False) def estimatefee_args(self,rpc): - return () if rpc.daemon_version >= 190100 else (opt.tx_confs,) + return () if rpc.daemon_version >= 190100 else (opt.fee_estimate_confs,) def sigfail_errmsg(self,e): return ( diff --git a/mmgen/proto/btc/tx/new.py b/mmgen/proto/btc/tx/new.py index bb1e24eb..067568c8 100755 --- a/mmgen/proto/btc/tx/new.py +++ b/mmgen/proto/btc/tx/new.py @@ -32,7 +32,7 @@ class New(Base,TxBase.New): async def get_rel_fee_from_network(self): try: - ret = await self.rpc.call('estimatesmartfee',opt.tx_confs,opt.fee_estimate_mode.upper()) + ret = await self.rpc.call('estimatesmartfee',opt.fee_estimate_confs,opt.fee_estimate_mode.upper()) fee_per_kb = ret['feerate'] if 'feerate' in ret else -2 fe_type = 'estimatesmartfee' except: @@ -58,7 +58,7 @@ class New(Base,TxBase.New): from_decimal = True ) if opt.verbose: msg(fmt(f""" - {fe_type.upper()} fee for {opt.tx_confs} confirmations: {fee_per_kb} {self.coin}/kB + {fe_type.upper()} fee for {opt.fee_estimate_confs} confirmations: {fee_per_kb} {self.coin}/kB TX size (estimated): {tx_size} bytes Fee adjustment factor: {opt.tx_fee_adj:.2f} Absolute fee (fee_per_kb * adj_factor * tx_size / 1024): {ret} {self.coin} diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index fb32fc00..93b40abb 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -151,13 +151,13 @@ class New(Base): else: desc = 'Network-estimated ({}, {} conf{})'.format( opt.fee_estimate_mode.upper(), - pink(str(opt.tx_confs)), - suf(opt.tx_confs) ) + pink(str(opt.fee_estimate_confs)), + suf(opt.fee_estimate_confs) ) fee_per_kb,fe_type = await self.get_rel_fee_from_network() if fee_per_kb < 0: if not have_estimate_fail: - msg(self.fee_fail_fs.format(c=opt.tx_confs,t=fe_type)) + msg(self.fee_fail_fs.format(c=opt.fee_estimate_confs,t=fe_type)) have_estimate_fail.append(True) start_fee = None else: