mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Sync blocks after generating in mine_quorum()
This commit is contained in:
parent
3e60d2d2db
commit
f8f867a6bb
@ -498,36 +498,44 @@ class DashTestFramework(BitcoinTestFramework):
|
|||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(skip_count)
|
self.nodes[0].generate(skip_count)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 1 (init)
|
# Make sure all reached phase 1 (init)
|
||||||
self.wait_for_quorum_phase(1, None, 0)
|
self.wait_for_quorum_phase(1, None, 0)
|
||||||
|
# Give nodes some time to connect to neighbors
|
||||||
|
sleep(2)
|
||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(2)
|
self.nodes[0].generate(2)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 2 (contribute) and received all contributions
|
# Make sure all reached phase 2 (contribute) and received all contributions
|
||||||
self.wait_for_quorum_phase(2, "receivedContributions", expected_valid_count)
|
self.wait_for_quorum_phase(2, "receivedContributions", expected_valid_count)
|
||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(2)
|
self.nodes[0].generate(2)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 3 (complain) and received all complaints
|
# Make sure all reached phase 3 (complain) and received all complaints
|
||||||
self.wait_for_quorum_phase(3, "receivedComplaints" if expected_valid_count != 10 else None, expected_valid_count)
|
self.wait_for_quorum_phase(3, "receivedComplaints" if expected_valid_count != 10 else None, expected_valid_count)
|
||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(2)
|
self.nodes[0].generate(2)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 4 (justify)
|
# Make sure all reached phase 4 (justify)
|
||||||
self.wait_for_quorum_phase(4, None, 0)
|
self.wait_for_quorum_phase(4, None, 0)
|
||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(2)
|
self.nodes[0].generate(2)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 5 (commit)
|
# Make sure all reached phase 5 (commit)
|
||||||
self.wait_for_quorum_phase(5, "receivedPrematureCommitments", expected_valid_count)
|
self.wait_for_quorum_phase(5, "receivedPrematureCommitments", expected_valid_count)
|
||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(2)
|
self.nodes[0].generate(2)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
# Make sure all reached phase 6 (mining)
|
# Make sure all reached phase 6 (mining)
|
||||||
self.wait_for_quorum_phase(6, None, 0)
|
self.wait_for_quorum_phase(6, None, 0)
|
||||||
@ -544,6 +552,7 @@ class DashTestFramework(BitcoinTestFramework):
|
|||||||
set_mocktime(get_mocktime() + 1)
|
set_mocktime(get_mocktime() + 1)
|
||||||
set_node_times(self.nodes, get_mocktime())
|
set_node_times(self.nodes, get_mocktime())
|
||||||
self.nodes[0].generate(1)
|
self.nodes[0].generate(1)
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
sync_blocks(self.nodes)
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user