From 826c60f96c47eccd4c60484717743bd5031b8c51 Mon Sep 17 00:00:00 2001 From: celbalrai <80897309+celbalrai@users.noreply.github.com> Date: Sat, 12 Jun 2021 08:36:53 +0200 Subject: [PATCH] Update tests and enabled tests --- .../feature_dip3_deterministicmns.py | 1 + test/functional/feature_llmq_simplepose.py | 4 ++-- test/functional/test_runner.py | 14 +++++------ test/functional/wallet_listreceivedby.py | 23 +++++++++++++------ 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/test/functional/feature_dip3_deterministicmns.py b/test/functional/feature_dip3_deterministicmns.py index eb6532968a9f7..f1ff37297352c 100755 --- a/test/functional/feature_dip3_deterministicmns.py +++ b/test/functional/feature_dip3_deterministicmns.py @@ -27,6 +27,7 @@ def set_test_params(self): self.extra_args = ["-budgetparams=10:10:10"] self.extra_args += ["-sporkkey=5rE5LTDq3tRhaPW3RT1De35MocGc9wD8foaBGioxSXJsn45XaFG"] self.extra_args += ["-dip3params=135:150"] + self.extra_args += ["-reservebalance=12000000"] def setup_network(self): diff --git a/test/functional/feature_llmq_simplepose.py b/test/functional/feature_llmq_simplepose.py index b9bf91a6695f9..93d85eb857c05 100755 --- a/test/functional/feature_llmq_simplepose.py +++ b/test/functional/feature_llmq_simplepose.py @@ -80,7 +80,7 @@ def close_mn_port(self, mn): def force_old_mn_proto(self, mn): self.stop_node(mn.node.index) - self.start_masternode(mn, ["-pushversion=70216"]) + self.start_masternode(mn, ["-pushversion=70915"]) connect_nodes(mn.node, 0) self.reset_probe_timeouts() return False @@ -143,7 +143,7 @@ def repair_masternodes(self, restart): def reset_probe_timeouts(self): # Make sure all masternodes will reconnect/re-probe - self.bump_mocktime(50 * 60 + 1) + self.bump_mocktime(62 * 60 + 1) # Sleep a couple of seconds to let mn sync tick to happen time.sleep(2) diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index a1ee649a292df..5c4cdc074c2d3 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -84,7 +84,7 @@ #'feature_llmq_simplepose.py', # NOTE: needs wagerr_hash to pass #'feature_llmq_is_cl_conflicts.py', # NOTE: needs wagerr_hash to pass 'feature_llmq_is_retroactive.py', # NOTE: needs wagerr_hash to pass - #'feature_llmq_dkgerrors.py', # NOTE: needs wagerr_hash to pass + 'feature_llmq_dkgerrors.py', #'feature_dip4_coinbasemerkleroots.py', # NOTE: needs wagerr_hash to pass # vv Tests less than 60s vv #'p2p_sendheaders.py', # NOTE: needs wagerr_hash to pass @@ -112,7 +112,7 @@ 'wallet_multiwallet.py', 'interface_http.py', 'rpc_users.py', - #'feature_proxy.py', + 'feature_proxy.py', #'rpc_signrawtransaction.py', 'p2p_disconnect_ban.py', #'feature_addressindex.py', @@ -136,9 +136,9 @@ 'rpc_signmessage.py', #'feature_nulldummy.py', 'wallet_import_rescan.py', - #'rpc_bind.py --ipv4', - #'rpc_bind.py --ipv6', - #'rpc_bind.py --nonloopback', + 'rpc_bind.py --ipv4', + 'rpc_bind.py --ipv6', + 'rpc_bind.py --nonloopback', 'mining_basic.py', 'rpc_named_arguments.py', #'wagerrlib.py', @@ -181,8 +181,8 @@ # Longest test should go first, to favor running tests in parallel #'feature_pruning.py', # NOTE: Prune mode is incompatible with -txindex, should work with governance validation disabled though. # vv Tests less than 20m vv - 'feature_fee_estimation.py', - 'feature_llmq_data_recovery.py', + #'feature_fee_estimation.py', + #'feature_llmq_data_recovery.py', # vv Tests less than 5m vv 'rpc_token_test_pt1.py', #'feature_maxuploadtarget.py', diff --git a/test/functional/wallet_listreceivedby.py b/test/functional/wallet_listreceivedby.py index 35d9205a4cf53..9a9e378f11e8c 100755 --- a/test/functional/wallet_listreceivedby.py +++ b/test/functional/wallet_listreceivedby.py @@ -12,6 +12,7 @@ assert_equal, assert_raises_rpc_error, sync_blocks, + find_vout_for_address, ) @@ -30,6 +31,8 @@ def run_test(self): addr = self.nodes[1].getnewaddress() txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() + lock_vout = find_vout_for_address(self.nodes[0], txid, addr) + self.nodes[1].lockunspent(False, [{"txid": txid, "vout": lock_vout}]) # Check not listed in listreceivedbyaddress because has 0 confirmations assert_array_result(self.nodes[1].listreceivedbyaddress(), @@ -39,9 +42,9 @@ def run_test(self): # Bury Tx under 10 block so it will be returned by listreceivedbyaddress self.nodes[1].generate(10) self.sync_all() - #assert_array_result(self.nodes[1].listreceivedbyaddress(), - # {"address": addr}, - # {"address": addr, "label": "", "amount": Decimal("0.1"), "confirmations": 10, "txids": [txid, ]}) + assert_array_result(self.nodes[1].listreceivedbyaddress(), + {"address": addr}, + {"address": addr, "label": "", "amount": Decimal("0.1"), "confirmations": 10, "txids": [txid, ]}) # With min confidence < 10 assert_array_result(self.nodes[1].listreceivedbyaddress(5), {"address": addr}, @@ -70,6 +73,8 @@ def run_test(self): txid2 = self.nodes[0].sendtoaddress(other_addr, 0.1) self.nodes[0].generate(1) self.sync_all() + lock_vout = find_vout_for_address(self.nodes[0], txid2, other_addr) + self.nodes[1].lockunspent(False, [{"txid": txid2, "vout": lock_vout}]) #Same test as above should still pass expected = {"address":addr, "label":"", "amount":Decimal("0.1"), "confirmations":11, "txids":[txid,]} res = self.nodes[1].listreceivedbyaddress(0, True, True, True, addr) @@ -95,6 +100,8 @@ def run_test(self): addr = self.nodes[1].getnewaddress() txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() + lock_vout = find_vout_for_address(self.nodes[0], txid, addr) + self.nodes[1].lockunspent(False, [{"txid": txid, "vout": lock_vout}]) # Check balance is 0 because of 0 confirmations balance = self.nodes[1].getreceivedbyaddress(addr) @@ -124,6 +131,8 @@ def run_test(self): txid = self.nodes[0].sendtoaddress(addr, 0.1) self.sync_all() + lock_vout = find_vout_for_address(self.nodes[0], txid, addr) + self.nodes[1].lockunspent(False, [{"txid": txid, "vout": lock_vout}]) # listreceivedbylabel should return received_by_label_json because of 0 confirmations assert_array_result(self.nodes[1].listreceivedbylabel(), @@ -137,13 +146,13 @@ def run_test(self): self.nodes[1].generate(10) self.sync_all() # listreceivedbylabel should return updated received list - #assert_array_result(self.nodes[1].listreceivedbylabel(), - # {"label": label}, - # {"label": received_by_label_json["label"], "amount": (received_by_label_json["amount"] + Decimal("0.1"))}) + assert_array_result(self.nodes[1].listreceivedbylabel(), + {"label": label}, + {"label": received_by_label_json["label"], "amount": (received_by_label_json["amount"] + Decimal("0.1"))}) # getreceivedbylabel should return updated receive total balance = self.nodes[1].getreceivedbylabel(label) - assert_equal(balance, balance_by_label + Decimal("10000.2")) + assert_equal(balance, balance_by_label + Decimal("0.1")) # Create a new label named "mynewlabel" that has a 0 balance address = self.nodes[1].getnewaddress()