Browse Source

minor fixes

The MMGen Project 2 years ago
parent
commit
20d35ea637

+ 1 - 1
mmgen/proto/btc/tx/new.py

@@ -81,7 +81,7 @@ class New(Base,TxBase.New):
 		msg(err)
 		return False
 
-	async def get_cmdline_input_addrs(self):
+	async def get_input_addrs_from_cmdline(self):
 		# Bitcoin full node, call doesn't go to the network, so just call listunspent with addrs=[]
 		return []
 

+ 3 - 3
mmgen/proto/eth/tx/new.py

@@ -77,7 +77,7 @@ class New(Base,TxBase.New):
 			'update_txid() must be called only when self.serialized is not hex data' )
 		self.txid = MMGenTxID(make_chksum_6(self.serialized).upper())
 
-	def process_cmd_args(self,cmd_args,ad_f,ad_w):
+	async def process_cmd_args(self,cmd_args,ad_f,ad_w):
 		lc = len(cmd_args)
 		if lc == 0 and self.usr_contract_data and not 'Token' in type(self).__name__:
 			return
@@ -85,7 +85,7 @@ class New(Base,TxBase.New):
 			die(1,f'{lc} output{suf(lc)} specified, but Ethereum transactions must have exactly one')
 
 		for a in cmd_args:
-			self.process_cmd_arg(a,ad_f,ad_w)
+			await self.process_cmd_arg(a,ad_f,ad_w)
 
 	def select_unspent(self,unspent):
 		from ....ui import line_input
@@ -141,7 +141,7 @@ class New(Base,TxBase.New):
 		if self.outputs and self.outputs[0].is_chg:
 			self.update_output_amt(0,ETHAmt(funds_left))
 
-	async def get_cmdline_input_addrs(self):
+	async def get_input_addrs_from_cmdline(self):
 		ret = []
 		if opt.inputs:
 			data_root = (await TwCtl(self.proto)).data_root # must create new instance here

+ 5 - 5
mmgen/tx/new.py

@@ -167,7 +167,7 @@ class New(Base):
 	def add_output(self,coinaddr,amt,is_chg=None):
 		self.outputs.append(self.Output(self.proto,addr=coinaddr,amt=amt,is_chg=is_chg))
 
-	def process_cmd_arg(self,arg,ad_f,ad_w):
+	async def process_cmd_arg(self,arg,ad_f,ad_w):
 
 		if ',' in arg:
 			addr,amt = arg.split(',',1)
@@ -189,10 +189,10 @@ class New(Base):
 
 		self.add_output(coin_addr,self.proto.coin_amt(amt or '0'),is_chg=not amt)
 
-	def process_cmd_args(self,cmd_args,ad_f,ad_w):
+	async def process_cmd_args(self,cmd_args,ad_f,ad_w):
 
 		for a in cmd_args:
-			self.process_cmd_arg(a,ad_f,ad_w)
+			await self.process_cmd_arg(a,ad_f,ad_w)
 
 		if self.get_chg_output_idx() == None:
 			die(2,(
@@ -230,7 +230,7 @@ class New(Base):
 
 		ad_w = await TwAddrData(self.proto,twctl=self.twctl)
 
-		self.process_cmd_args(cmd_args,ad_f,ad_w)
+		await self.process_cmd_args(cmd_args,ad_f,ad_w)
 
 		self.add_mmaddrs_to_outputs(ad_w,ad_f)
 		self.check_dup_addrs('outputs')
@@ -351,7 +351,7 @@ class New(Base):
 		if opt.comment_file:
 			self.add_comment(opt.comment_file)
 
-		twuo_addrs = await self.get_cmdline_input_addrs()
+		twuo_addrs = await self.get_input_addrs_from_cmdline()
 
 		self.twuo = await TwUnspentOutputs(self.proto,minconf=opt.minconf,addrs=twuo_addrs)
 		await self.twuo.get_data()

+ 1 - 1
test/overlay/fakemods/mmgen/tw/common.py → test/overlay/fakemods/mmgen/tw/view.py

@@ -1,5 +1,5 @@
 import os as overlay_fake_os
-from .common_orig import *
+from .view_orig import *
 
 if overlay_fake_os.getenv('MMGEN_TEST_SUITE_DETERMINISTIC'):
 

+ 3 - 2
test/test_py_d/ts_regtest.py

@@ -372,6 +372,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 		self.write_to_tmpfile('wallet_password',rt_pw)
 
 		self.dfl_mmtype = 'C' if self.proto.coin == 'BCH' else 'B'
+		self.burn_addr = make_burn_addr(self.proto)
 
 	def __del__(self):
 		os.environ['MMGEN_BOGUS_SEND'] = '1'
@@ -506,7 +507,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 
 		return self.user_txdo(
 			'bob', '40s',
-			[ f'{addr},{rtFundAmt}', make_burn_addr(self.proto) ],
+			[ f'{addr},{rtFundAmt}', self.burn_addr ],
 			utxo_nums,
 			extra_args = [f'--keys-from-file={keyfile}'],
 			skip_passphrase = skip_passphrase )
@@ -757,7 +758,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 	def bob_nochg_burn(self):
 		return self.user_txdo('bob',
 			fee          = '0.00009713',
-			outputs_cl   = [f'{make_burn_addr(self.proto)}'],
+			outputs_cl   = [self.burn_addr],
 			outputs_list = '1' )
 
 	def bob_alice_bal(self):