Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-finalize-block.py
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.log.info("Try to finalized a block on a competiting fork...") | self.log.info("Try to finalized a block on a competiting fork...") | ||||
assert_raises_rpc_error(-20, RPC_FINALIZE_INVALID_BLOCK_ERROR, | assert_raises_rpc_error(-20, RPC_FINALIZE_INVALID_BLOCK_ERROR, | ||||
node.finalizeblock, alt_node.getbestblockhash()) | node.finalizeblock, alt_node.getbestblockhash()) | ||||
assert node.getfinalizedblockhash() != alt_node.getbestblockhash(), \ | assert node.getfinalizedblockhash() != alt_node.getbestblockhash(), \ | ||||
"Finalize block is alt_node's tip!" | "Finalize block is alt_node's tip!" | ||||
assert_equal(node.getfinalizedblockhash(), finalized_block) | assert_equal(node.getfinalizedblockhash(), finalized_block) | ||||
self.log.info( | |||||
"Make sure reconsidering block move the finalization point...") | |||||
node.reconsiderblock(alt_node.getbestblockhash()) | |||||
assert_equal(node.getbestblockhash(), alt_node.getbestblockhash()) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
FinalizeBlockTest().main() | FinalizeBlockTest().main() |