diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index 3ce67d75..bf8c83d3 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -108,7 +108,6 @@ class GlobalContext(Lockable): monero_wallet_rpc_host = 'localhost' monero_wallet_rpc_user = 'monero' monero_wallet_rpc_password = '' - rpc_fail_on_command = '' aiohttp_rpc_queue_len = 16 session = None cached_balances = False diff --git a/mmgen/rpc.py b/mmgen/rpc.py index b8c51db8..639e882c 100755 --- a/mmgen/rpc.py +++ b/mmgen/rpc.py @@ -314,8 +314,6 @@ class RPCClient(MMGenObject): """ default call: call with param list unrolled, exactly as with cli """ - if method == g.rpc_fail_on_command: - method = 'badcommand_' + method return await self.process_http_resp(self.backend.run( payload = {'id': 1, 'jsonrpc': '2.0', 'method': method, 'params': params }, timeout = timeout, @@ -715,7 +713,8 @@ class MoneroWalletRPCClient(MoneroRPCClient): 'create_wallet', # filename, password, language="English" 'open_wallet', # filename, password 'close_wallet', - 'restore_deterministic_wallet', # name,password,seed (restore_height,language,seed_offset,autosave_current) + # filename,password,seed (restore_height,language,seed_offset,autosave_current) + 'restore_deterministic_wallet', 'refresh', # start_height ) diff --git a/mmgen/xmrwallet.py b/mmgen/xmrwallet.py index 867eaf7a..99e96408 100755 --- a/mmgen/xmrwallet.py +++ b/mmgen/xmrwallet.py @@ -292,7 +292,8 @@ class MoneroWalletOps: Proxy: {blue(m[2] or 'None')} """,strip_char='\t',indent=indent)) - def post_main(self): pass + def post_main(self): + pass def stop_daemons(self): pass @@ -384,7 +385,10 @@ class MoneroWalletOps: len(self.addr_data), os.path.basename(fn), )) - processed += await self.process_wallet(d,fn) + processed += await self.process_wallet( + d, + fn, + last = n == len(self.addr_data)-1 ) gmsg(f'\n{processed} wallet{suf(processed)} {self.past}') return processed @@ -569,7 +573,7 @@ class MoneroWalletOps: if int(uopt.restore_height) < 0: die(1,f"{uopt.restore_height}: invalid value for --restore-height (less than zero)") - async def process_wallet(self,d,fn): + async def process_wallet(self,d,fn,last): msg_r('') # for pexpect from .baseconv import baseconv @@ -598,7 +602,7 @@ class MoneroWalletOps: self.dc = MoneroRPCClientRaw(host=host, port=int(port), user=None, passwd=None) self.accts_data = {} - async def process_wallet(self,d,fn): + async def process_wallet(self,d,fn,last): chain_height = (await self.dc.call('get_height'))['height'] msg(f' Chain height: {chain_height}') diff --git a/test/include/common.py b/test/include/common.py index f8e5b1de..bafba37d 100755 --- a/test/include/common.py +++ b/test/include/common.py @@ -139,10 +139,12 @@ def joinpath(*args,**kwargs): return os.path.join(*args,**kwargs) def ok(): - if opt.profile: return + if opt.profile: + return if opt.verbose or opt.exact_output: gmsg('OK') - else: msg(' OK') + else: + msg(' OK') def cmp_or_die(s,t,desc=None): if s != t: diff --git a/test/overlay/__init__.py b/test/overlay/__init__.py index a89ee58a..16c9fc01 100644 --- a/test/overlay/__init__.py +++ b/test/overlay/__init__.py @@ -29,6 +29,7 @@ def overlay_setup(repo_root): make_link = os.symlink if sys.platform == 'linux' else shutil.copy2 if not os.path.exists(os.path.join(overlay_dir,'mmgen','main.py')): + sys.stderr.write('Setting up overlay tree\n') for d in ( 'mmgen', 'mmgen.data', diff --git a/test/test_py_d/ts_xmrwallet.py b/test/test_py_d/ts_xmrwallet.py index 16732906..78438533 100755 --- a/test/test_py_d/ts_xmrwallet.py +++ b/test/test_py_d/ts_xmrwallet.py @@ -87,14 +87,14 @@ class TestSuiteXMRWallet(TestSuiteBase): self.tx_relay_daemon_parm + f':127.0.0.1:{self.socks_port}' # proxy must be IP, not 'localhost' if self.use_proxy else None ) - if not opt.no_daemon_autostart: - self.start_daemons() - self.start_wallet_daemons() - if not opt.no_daemon_stop: atexit.register(self.stop_daemons) atexit.register(self.stop_wallet_daemons) + if not opt.no_daemon_autostart: + self.start_daemons() + self.start_wallet_daemons() + self.balance = None # init methods diff --git a/test/unit_tests_d/ut_daemon.py b/test/unit_tests_d/ut_daemon.py index 5f1b533e..10d63eaa 100755 --- a/test/unit_tests_d/ut_daemon.py +++ b/test/unit_tests_d/ut_daemon.py @@ -121,6 +121,13 @@ class unit_tests: msg('OK') return True + def status(self,name,ut): + msg_r('Checking status of coin daemons...') + qmsg('') + test_cmds('start') + msg('OK') + return True + def stop(self,name,ut): msg_r('Stopping coin daemons...') qmsg('') diff --git a/test/unit_tests_d/ut_rpc.py b/test/unit_tests_d/ut_rpc.py index 2bfd60b5..1aee3ca2 100755 --- a/test/unit_tests_d/ut_rpc.py +++ b/test/unit_tests_d/ut_rpc.py @@ -116,7 +116,7 @@ class unit_tests: MoneroWalletDaemon( proto = proto, test_suite = True, - wallet_dir = 'test/trash', + wallet_dir = 'test/trash2', passwd = 'ut_rpc_passw0rd' ) ) for proto in (init_proto('xmr',network=network) for network in networks) ] @@ -140,5 +140,8 @@ class unit_tests: gmsg('OK') + import shutil + shutil.rmtree('test/trash2',ignore_errors=True) + os.makedirs('test/trash2') run_session(run()) return True