Browse Source

minor fixes and cleanups

The MMGen Project 3 years ago
parent
commit
ecf489af0e
4 changed files with 24 additions and 29 deletions
  1. 12 13
      setup.py
  2. 1 1
      test/test.py
  3. 9 13
      test/test_py_d/ts_regtest.py
  4. 2 2
      test/test_py_d/ts_xmrwallet.py

+ 12 - 13
setup.py

@@ -148,7 +148,6 @@ setup(
 			'mmgen.txsign',
 			'mmgen.util',
 			'mmgen.wallet',
-			'mmgen.xmrwallet',
 
 			'mmgen.altcoins.__init__',
 
@@ -196,24 +195,24 @@ setup(
 		],
 		scripts = [
 			'cmds/mmgen-addrgen',
-			'cmds/mmgen-keygen',
-			'cmds/mmgen-passgen',
 			'cmds/mmgen-addrimport',
+			'cmds/mmgen-autosign',
+			'cmds/mmgen-keygen',
 			'cmds/mmgen-passchg',
+			'cmds/mmgen-passgen',
 			'cmds/mmgen-regtest',
-			'cmds/mmgen-subwalletgen',
-			'cmds/mmgen-walletchk',
-			'cmds/mmgen-walletconv',
-			'cmds/mmgen-walletgen',
-			'cmds/mmgen-seedsplit',
 			'cmds/mmgen-seedjoin',
+			'cmds/mmgen-seedsplit',
 			'cmds/mmgen-split',
-			'cmds/mmgen-txcreate',
+			'cmds/mmgen-subwalletgen',
+			'cmds/mmgen-tool',
 			'cmds/mmgen-txbump',
-			'cmds/mmgen-txsign',
-			'cmds/mmgen-txsend',
+			'cmds/mmgen-txcreate',
 			'cmds/mmgen-txdo',
-			'cmds/mmgen-tool',
-			'cmds/mmgen-autosign'
+			'cmds/mmgen-txsend',
+			'cmds/mmgen-txsign',
+			'cmds/mmgen-walletchk',
+			'cmds/mmgen-walletconv',
+			'cmds/mmgen-walletgen',
 		]
 	)

+ 1 - 1
test/test.py

@@ -672,7 +672,7 @@ class TestSuiteRunner(object):
 			args = ['python3'] + args
 
 		for i in args:
-			if type(i) != str:
+			if not isinstance(i,str):
 				m = 'Error: missing input files in cmd line?:\nName: {}\nCmdline: {!r}'
 				die(2,m.format(self.ts.test_name,args))
 

+ 9 - 13
test/test_py_d/ts_regtest.py

@@ -731,19 +731,15 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared):
 			'Replacement transaction has 2 confirmations',
 			'Replacing transactions:\s+{}'.format(new_txid))
 
-	@staticmethod
-	def _gen_pairs(n):
-		if not g.debug_utf8:
-			disable_debug()
-		from subprocess import run,PIPE
-		ret = [run(['python3',joinpath('cmds','mmgen-tool'),'--regtest=1'] +
-					(['--type=compressed'],[])[i==0] +
-					['-r0','randpair'],
-					stdout=PIPE,check=True
-				).stdout.decode().split() for i in range(n)]
-		if not g.debug_utf8:
-			restore_debug()
-		return ret
+	def _gen_pairs(self,n):
+		from mmgen.tool import tool_api
+		t = tool_api()
+		t.init_coin(self.proto.coin,self.proto.network)
+		t.usr_randchars = 0
+		t.addrtype = 'legacy'
+		ret = [t.randpair()]
+		t.addrtype = 'compressed'
+		return ret + [t.randpair() for i in range(n-1)]
 
 	def bob_pre_import(self):
 		pairs = self._gen_pairs(5)

+ 2 - 2
test/test_py_d/ts_xmrwallet.py

@@ -131,8 +131,8 @@ class TestSuiteXMRWallet(TestSuiteBase):
 				self.use_proxy = True
 			elif 'onnection refused' in err:
 				die(2,fmt("""
-					The SSH daemon must running and listening on localhost in order to test XMR
-					TX relaying via SOCKS proxy.  If sshd is not running, please start it.
+					The SSH daemon must be running and listening on localhost in order to test
+					XMR TX relaying via SOCKS proxy.  If sshd is not running, please start it.
 					Otherwise, add the line 'ListenAddress 127.0.0.1' to your sshd_config, and
 					then restart the daemon.
 				""",indent='    '))