Changeset View
Changeset View
Standalone View
Standalone View
test/functional/invalidateblock.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 The Bitcoin Core 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 InvalidateBlock code | # Test InvalidateBlock code | ||||
# | # | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import * | from test_framework.util import * | ||||
# Defer magnetic anomaly until far in the future, so this test can operate | |||||
# normally | |||||
# TODO: T483 | |||||
MAGNETIC_ANOMALY_START_TIME = 2000000000 | |||||
class InvalidateTest(BitcoinTestFramework): | class InvalidateTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 3 | self.num_nodes = 3 | ||||
self.extra_args = [['-magneticanomalyactivationtime=%d' % MAGNETIC_ANOMALY_START_TIME], ['-magneticanomalyactivationtime=%d' % | |||||
MAGNETIC_ANOMALY_START_TIME], ['-magneticanomalyactivationtime=%d' % MAGNETIC_ANOMALY_START_TIME]] | |||||
def setup_network(self): | def setup_network(self): | ||||
self.setup_nodes() | self.setup_nodes() | ||||
def run_test(self): | def run_test(self): | ||||
self.log.info( | self.log.info( | ||||
"Make sure we repopulate setBlockIndexCandidates after InvalidateBlock:") | "Make sure we repopulate setBlockIndexCandidates after InvalidateBlock:") | ||||
self.log.info("Mine 4 blocks on Node 0") | self.log.info("Mine 4 blocks on Node 0") | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |