tests: Use wait_for_chainlocked_block_all_nodes in more places (#4139)

This commit is contained in:
UdjinM6 2021-05-11 19:55:40 +03:00 committed by GitHub
parent 5285bd801c
commit 5cdd67ed53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -61,7 +61,7 @@ class LLMQChainLocksTest(DashTestFramework):
assert(self.nodes[0].getbestblockhash() == node0_tip) assert(self.nodes[0].getbestblockhash() == node0_tip)
reconnect_isolated_node(self.nodes[0], 1) reconnect_isolated_node(self.nodes[0], 1)
self.nodes[1].generatetoaddress(1, node0_mining_addr) self.nodes[1].generatetoaddress(1, node0_mining_addr)
self.wait_for_chainlocked_block(self.nodes[0], self.nodes[1].getbestblockhash()) self.wait_for_chainlocked_block_all_nodes(self.nodes[1].getbestblockhash())
self.log.info("Isolate node, mine on both parts of the network, and reconnect") self.log.info("Isolate node, mine on both parts of the network, and reconnect")
isolate_node(self.nodes[0]) isolate_node(self.nodes[0])
@ -72,7 +72,7 @@ class LLMQChainLocksTest(DashTestFramework):
assert(not self.nodes[0].getblock(self.nodes[0].getbestblockhash())["chainlock"]) assert(not self.nodes[0].getblock(self.nodes[0].getbestblockhash())["chainlock"])
reconnect_isolated_node(self.nodes[0], 1) reconnect_isolated_node(self.nodes[0], 1)
self.nodes[1].generatetoaddress(1, node0_mining_addr) self.nodes[1].generatetoaddress(1, node0_mining_addr)
self.wait_for_chainlocked_block(self.nodes[0], self.nodes[1].getbestblockhash()) self.wait_for_chainlocked_block_all_nodes(self.nodes[1].getbestblockhash())
assert(self.nodes[0].getblock(self.nodes[0].getbestblockhash())["previousblockhash"] == good_tip) assert(self.nodes[0].getblock(self.nodes[0].getbestblockhash())["previousblockhash"] == good_tip)
assert(self.nodes[1].getblock(self.nodes[1].getbestblockhash())["previousblockhash"] == good_tip) assert(self.nodes[1].getblock(self.nodes[1].getbestblockhash())["previousblockhash"] == good_tip)
@ -107,7 +107,7 @@ class LLMQChainLocksTest(DashTestFramework):
assert(self.nodes[0].getbestblockhash() != good_tip) assert(self.nodes[0].getbestblockhash() != good_tip)
good_fork = good_tip good_fork = good_tip
good_tip = self.nodes[1].generatetoaddress(1, node0_mining_addr)[-1] # this should mark bad_tip as conflicting good_tip = self.nodes[1].generatetoaddress(1, node0_mining_addr)[-1] # this should mark bad_tip as conflicting
self.wait_for_chainlocked_block(self.nodes[0], good_tip) self.wait_for_chainlocked_block_all_nodes(good_tip)
assert(self.nodes[0].getbestblockhash() == good_tip) assert(self.nodes[0].getbestblockhash() == good_tip)
found = False found = False
for tip in self.nodes[0].getchaintips(2): for tip in self.nodes[0].getchaintips(2):

View File

@ -173,7 +173,7 @@ class QuorumDataRecoveryTest(DashTestFramework):
self.test_mns(llmq_test, quorum_hash_recover, valid_mns=member_mns_recover_test, recover=True) self.test_mns(llmq_test, quorum_hash_recover, valid_mns=member_mns_recover_test, recover=True)
self.test_mns(llmq_test_v17, quorum_hash_recover, valid_mns=member_mns_recover_v17, recover=True) self.test_mns(llmq_test_v17, quorum_hash_recover, valid_mns=member_mns_recover_v17, recover=True)
# Mining a block should result in a chainlock now because the quorum should be healed # Mining a block should result in a chainlock now because the quorum should be healed
self.wait_for_chainlocked_block(node, node.getbestblockhash()) self.wait_for_chainlocked_block_all_nodes(node.getbestblockhash())
logger.info("Test -llmq-qvvec-sync command line parameter") logger.info("Test -llmq-qvvec-sync command line parameter")
# Run with one type separated and then both possible (for regtest) together, both calls generate new quorums # Run with one type separated and then both possible (for regtest) together, both calls generate new quorums
# and are restarting the nodes with the other parameters # and are restarting the nodes with the other parameters

View File

@ -142,8 +142,7 @@ class LLMQ_IS_CL_Conflicts(DashTestFramework):
# The block should get accepted now, and at the same time prune the conflicting ISLOCKs # The block should get accepted now, and at the same time prune the conflicting ISLOCKs
assert(submit_result is None) assert(submit_result is None)
for node in self.nodes: self.wait_for_chainlocked_block_all_nodes(block.hash)
self.wait_for_chainlocked_block(node, block.hash)
# Create a chained TX on top of tx2 # Create a chained TX on top of tx2
inputs = [] inputs = []

View File

@ -40,6 +40,7 @@ class RPCVerifyChainLockTest(DashTestFramework):
assert node0.verifychainlock(block_hash, chainlock_signature, height) assert node0.verifychainlock(block_hash, chainlock_signature, height)
# Invalid "blockHash" # Invalid "blockHash"
assert not node0.verifychainlock(node0.getblockhash(0), chainlock_signature, height) assert not node0.verifychainlock(node0.getblockhash(0), chainlock_signature, height)
self.wait_for_chainlocked_block_all_nodes(block_hash)
# Isolate node1, mine a block on node0 and wait for its ChainLock # Isolate node1, mine a block on node0 and wait for its ChainLock
node1.setnetworkactive(False) node1.setnetworkactive(False)
node0.generate(1) node0.generate(1)