Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-finalize-block.py
Show First 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# On delay_node: | # On delay_node: | ||||
# >(220 auto-finalized)-> // ->(230 tip) | # >(220 auto-finalized)-> // ->(230 tip) | ||||
# / | # / | ||||
# (200)->(201)-> // ->(209)->(210) | # (200)->(201)-> // ->(209)->(210) | ||||
self.mocktime += self.finalization_delay | self.mocktime += self.finalization_delay | ||||
set_node_times([delay_node], self.mocktime) | set_node_times([delay_node], self.mocktime) | ||||
new_tip = alt_node.generatetoaddress( | new_tip = alt_node.generatetoaddress( | ||||
1, alt_node.get_deterministic_priv_key().address)[-1] | 1, alt_node.get_deterministic_priv_key().address)[-1] | ||||
wait_for_tip(delay_node, new_tip) | |||||
assert_equal(alt_node.getbestblockhash(), new_tip) | assert_equal(alt_node.getbestblockhash(), new_tip) | ||||
assert_equal(node.getfinalizedblockhash(), block_to_autofinalize) | |||||
assert_equal(alt_node.getfinalizedblockhash(), block_to_autofinalize) | assert_equal(alt_node.getfinalizedblockhash(), block_to_autofinalize) | ||||
wait_for_tip(node, new_tip) | |||||
assert_equal(node.getfinalizedblockhash(), block_to_autofinalize) | |||||
wait_for_tip(delay_node, new_tip) | |||||
self.log.info( | self.log.info( | ||||
"Check that finalization delay is effective on node boot") | "Check that finalization delay is effective on node boot") | ||||
# Restart the new node, so the blocks have no header received time. | # Restart the new node, so the blocks have no header received time. | ||||
self.restart_node(2) | self.restart_node(2) | ||||
# There should be no finalized block (getfinalizedblockhash returns an | # There should be no finalized block (getfinalizedblockhash returns an | ||||
# empty string) | # empty string) | ||||
assert_equal(delay_node.getfinalizedblockhash(), str()) | assert_equal(delay_node.getfinalizedblockhash(), str()) | ||||
Show All 38 Lines |