Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-parkedchain.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2018 The Bitcoin developers | # Copyright (c) 2018 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the parckblock and unparkblock RPC calls.""" | """Test the parckblock and unparkblock RPC calls.""" | ||||
import os | import os | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import assert_equal, connect_nodes_bi, sync_blocks, wait_until | from test_framework.util import assert_equal, connect_nodes_bi, sync_blocks, wait_until | ||||
class ParkedChainTest(BitcoinTestFramework): | class ParkedChainTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.extra_args = [["-noparkdeepreorg"], []] | self.extra_args = [["-noparkdeepreorg"], ["-maxreorgdepth=-1"]] | ||||
# There should only be one chaintip, which is expected_tip | # There should only be one chaintip, which is expected_tip | ||||
def only_valid_tip(self, expected_tip, other_tip_status=None): | def only_valid_tip(self, expected_tip, other_tip_status=None): | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
assert_equal(node.getbestblockhash(), expected_tip) | assert_equal(node.getbestblockhash(), expected_tip) | ||||
for tip in node.getchaintips(): | for tip in node.getchaintips(): | ||||
if tip["hash"] == expected_tip: | if tip["hash"] == expected_tip: | ||||
assert_equal(tip["status"], "active") | assert_equal(tip["status"], "active") | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |