Browse Source

option rename: --tx-fee -> --fee

This change breaks compatibility.  Scripts may need to be adjusted.
The MMGen Project 2 years ago
parent
commit
ad1286ab97

+ 2 - 2
mmgen/main_split.py

@@ -116,8 +116,8 @@ from .protocol import init_proto
 if opt.tx_fees:
 	for idx,g_coin in ((1,opt.other_coin),(0,proto.coin)):
 		proto = init_proto(g_coin)
-		opt.tx_fee = opt.tx_fees.split(',')[idx]
-		opts.opt_is_tx_fee('foo',opt.tx_fee,'transaction fee') # raises exception on error
+		opt.fee = opt.tx_fees.split(',')[idx]
+		opts.opt_is_tx_fee('foo',opt.fee,'transaction fee') # raises exception on error
 
 tx1 = MMGenSplitTX()
 opt.no_blank = True

+ 3 - 3
mmgen/main_txbump.py

@@ -41,7 +41,7 @@ opts_data = {
 -c, --comment-file=  f Source the transaction's comment from file 'f'
 -d, --outdir=        d Specify an alternate directory 'd' for output
 -e, --echo-passphrase  Print passphrase to screen when typing it
--f, --tx-fee=        f Transaction fee, as a decimal {cu} amount or as
+-f, --fee=           f Transaction fee, as a decimal {cu} amount or as
                        {fu} (an integer followed by {fl!r}).
                        See FEE SPECIFICATION below.
 -H, --hidden-incog-input-params=f,o  Read hidden incognito data from file
@@ -114,7 +114,7 @@ seed_files = get_seed_files(opt,cmd_args) if (cmd_args or opt.send) else None
 from .ui import do_license_msg
 do_license_msg()
 
-silent = opt.yes and opt.tx_fee != None and opt.output_to_reduce != None
+silent = opt.yes and opt.fee != None and opt.output_to_reduce != None
 
 from .tx import CompletedTX,BumpTX,UnsignedTX,OnlineSignedTX
 
@@ -148,7 +148,7 @@ async def main():
 	if not silent:
 		msg(f'Minimum fee for new transaction: {tx.min_fee.hl()} {tx.proto.coin}')
 
-	tx.usr_fee = tx.get_usr_fee_interactive(tx_fee=opt.tx_fee,desc='User-selected')
+	tx.usr_fee = tx.get_usr_fee_interactive(tx_fee=opt.fee,desc='User-selected')
 
 	tx.bump_fee(output_idx,tx.usr_fee)
 

+ 1 - 1
mmgen/main_txcreate.py

@@ -40,7 +40,7 @@ opts_data = {
 -D, --contract-data=D Path to hex-encoded contract data (ETH only)
 -E, --fee-estimate-mode=M Specify the network fee estimate mode.  Choices:
                       {fe_all}.  Default: {fe_dfl!r}
--f, --tx-fee=      f  Transaction fee, as a decimal {cu} amount or as
+-f, --fee=         f  Transaction fee, as a decimal {cu} amount or as
                       {fu} (an integer followed by {fl!r}).
                       See FEE SPECIFICATION below.  If omitted, fee will be
                       calculated using network fee estimation.

+ 1 - 1
mmgen/main_txdo.py

@@ -44,7 +44,7 @@ opts_data = {
 -e, --echo-passphrase  Print passphrase to screen when typing it
 -E, --fee-estimate-mode=M Specify the network fee estimate mode.  Choices:
                        {fe_all}.  Default: {fe_dfl!r}
--f, --tx-fee=        f Transaction fee, as a decimal {cu} amount or as
+-f, --fee=           f Transaction fee, as a decimal {cu} amount or as
                        {fu} (an integer followed by {fl!r}).
                        See FEE SPECIFICATION below.  If omitted, fee will be
                        calculated using network fee estimation.

+ 2 - 2
mmgen/tx/new.py

@@ -145,9 +145,9 @@ class New(Base):
 
 	async def get_fee_from_user(self,have_estimate_fail=[]):
 
-		if opt.tx_fee:
+		if opt.fee:
 			desc = 'User-selected'
-			start_fee = opt.tx_fee
+			start_fee = opt.fee
 		else:
 			desc = 'Network-estimated ({}, {} conf{})'.format(
 				opt.fee_estimate_mode.upper(),

+ 5 - 5
test/test_py_d/ts_ethdev.py

@@ -921,7 +921,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 		fn = joinpath(self.tmpdir,'mm'+str(num),key+'.bin')
 		args = [
 			'-B',
-			f'--tx-fee={tx_fee}',
+			f'--fee={tx_fee}',
 			f'--tx-gas={gas}',
 			f'--contract-data={fn}',
 			f'--inputs={dfl_devaddr}',
@@ -1067,7 +1067,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 
 	def token_txcreate(self,args=[],token='',inputs='1',fee='50G'):
 		return self.txcreate_ui_common(
-			self.spawn('mmgen-txcreate', self.eth_args + ['--token='+token,'-B','--tx-fee='+fee] + args),
+			self.spawn('mmgen-txcreate', self.eth_args + ['--token='+token,'-B','--fee='+fee] + args),
 			menu              = [],
 			inputs            = inputs,
 			input_sels_prompt = 'to spend from',
@@ -1180,17 +1180,17 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 		return self.twview(args=['--token=mm1','--cached-balances'])
 
 	def txcreate_cached_balances(self):
-		args = ['--tx-fee=20G','--cached-balances','98831F3A:E:3,0.1276']
+		args = ['--fee=20G','--cached-balances','98831F3A:E:3,0.1276']
 		return self.txcreate(args=args,acct='2')
 	def token_txcreate_cached_balances(self):
-		args=['--cached-balances','--tx-fee=12G','98831F3A:E:12,1.2789']
+		args=['--cached-balances','--fee=12G','98831F3A:E:12,1.2789']
 		return self.token_txcreate(args=args,token='mm1')
 
 	def txdo_cached_balances(self,
 			acct = '2',
 			fee_res_data = ('0.00105','50'),
 			add_args = ['98831F3A:E:3,0.4321']):
-		args = ['--tx-fee=20G','--cached-balances'] + add_args + [dfl_words_file]
+		args = ['--fee=20G','--cached-balances'] + add_args + [dfl_words_file]
 		t = self.txcreate(args=args,acct=acct,caller='txdo',fee_res_data=fee_res_data,no_read=True)
 		self._do_confirm_send(t,quiet=not g.debug,sure=False)
 		return t

+ 2 - 2
test/test_py_d/ts_regtest.py

@@ -802,7 +802,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 
 		t = self.spawn('mmgen-txdo',
 			['-d',self.tmpdir,'-B','--'+user] +
-			(['--tx-fee='+fee] if fee else []) +
+			(['--fee='+fee] if fee else []) +
 			extra_args + ([],[wf])[bool(wf)] + outputs_cl)
 
 		self.txcreate_ui_common(t,
@@ -889,7 +889,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		if not self.proto.cap('rbf'):
 			return 'skip'
 		t = self.spawn('mmgen-txbump',
-			['-d',outdir,'--'+user,'--tx-fee='+fee,'--output-to-reduce=c'] + add_args + [txfile])
+			['-d',outdir,'--'+user,'--fee='+fee,'--output-to-reduce=c'] + add_args + [txfile])
 		if not one_output:
 			t.expect('OK? (Y/n): ','y') # output OK?
 		t.expect('OK? (Y/n): ','y') # fee OK?