From 887d54fd813d6093060c3a1d30a1ffd171595a17 Mon Sep 17 00:00:00 2001 From: SirSevenG Date: Thu, 1 Aug 2019 16:13:30 +0700 Subject: [PATCH] cleanup and recheck --- qa/rpc-tests/nspv_client_test.py | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/qa/rpc-tests/nspv_client_test.py b/qa/rpc-tests/nspv_client_test.py index d5d1e4bba..e247a45a2 100644 --- a/qa/rpc-tests/nspv_client_test.py +++ b/qa/rpc-tests/nspv_client_test.py @@ -10,26 +10,36 @@ specify chain ticker (daemon should be up), wif which will be imported and addre added 1 second sleep after each case to surely not face the nSPV server limitation (1 call/second) ''' -wif = 'UsJgUBrmcsthJEGbyBBfD77tZ1FuRMkB68jqkP8E3PEE88eXesEH' -dest_address = 'RNvAWip4DuFrZf8WhqdTBEcAg1bWjd4rKr' +wif = '' +dest_address = '' amount = '0.1' chain = 'ILN' +if not wif or not dest_address: + raise Exception("Please set test wif and address to send transactions to.") + rpc_proxy = tuilib.def_credentials(chain) -# TODO: add brand new methods, add one-utxo-only addr for test purpose, recheck test once more at least class TestNspvClient(unittest.TestCase): + def test_nspv_mempool(self): + print("testing nspv_mempool") + result = rpc_proxy.nspv_mempool("0", dest_address, "0") + self.assertEqual(result["result"], "success") + self.assertEqual(result["address"], dest_address) + self.assertEqual(result["isCC"], 0) + time.sleep(1) + def test_nspv_listtransactions(self): print("testing nspv_listtransactions") rpc_proxy.nspv_login(wif) result = rpc_proxy.nspv_listtransactions() self.assertEqual(result["result"], "success") time.sleep(1) - result = rpc_proxy.nspv_listtransactions("RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") + result = rpc_proxy.nspv_listtransactions("RUp3xudmdTtxvaRnt3oq78FJBjotXy55uu") self.assertEqual(result["result"], "success") - self.assertEqual(result["address"], "RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") + self.assertEqual(result["address"], "RUp3xudmdTtxvaRnt3oq78FJBjotXy55uu") rpc_proxy.nspv_logout() def test_nspv_getinfo(self): @@ -47,16 +57,6 @@ class TestNspvClient(unittest.TestCase): self.assertEqual(result["next"]["notarized_height"], 2008) # check suspicious behaviour time.sleep(1) - def test_nspv_listtransactions(self): - print("testing nspv_listtransactions") - result = rpc_proxy.nspv_listtransactions() - self.assertEqual(result["result"], "success") - time.sleep(1) - result = rpc_proxy.nspv_listunspent("RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") - self.assertEqual(result["result"], "success") - self.assertEqual(result["address"], "RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") - - def test_nspv_hdrsproof(self): print("testing nspv_hdrsproof") result = rpc_proxy.nspv_hdrsproof("2000", "2100") @@ -76,9 +76,9 @@ class TestNspvClient(unittest.TestCase): result = rpc_proxy.nspv_listunspent() self.assertEqual(result["result"], "success") time.sleep(1) - result = rpc_proxy.nspv_listunspent("RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") + result = rpc_proxy.nspv_listunspent("RUp3xudmdTtxvaRnt3oq78FJBjotXy55uu") self.assertEqual(result["result"], "success") - self.assertEqual(result["address"], "RQ1mvCUcziWzRwE8Ugtex29VjoFjRzxQJT") + self.assertEqual(result["address"], "RUp3xudmdTtxvaRnt3oq78FJBjotXy55uu") def test_nspv_spend(self): print("testing nspv_spend")