Skip to content

Commit

Permalink
Update tests and enabled tests
Browse files Browse the repository at this point in the history
  • Loading branch information
celbalrai authored and wagerr-builder committed Jun 15, 2022
1 parent 463df20 commit 6e5345c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions test/functional/feature_dip3_deterministicmns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions test/functional/feature_llmq_simplepose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
14 changes: 7 additions & 7 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
23 changes: 16 additions & 7 deletions test/functional/wallet_listreceivedby.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
assert_equal,
assert_raises_rpc_error,
sync_blocks,
find_vout_for_address,
)


Expand All @@ -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(),
Expand All @@ -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},
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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(),
Expand All @@ -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()
Expand Down

0 comments on commit 6e5345c

Please sign in to comment.