Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-magnetic-anomaly-mining.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 that mining RPC continues to supply correct transaction metadata after | Test that mining RPC continues to supply correct transaction metadata after | ||||
the Nov 2018 protocol upgrade which engages canonical transaction ordering | the Nov 2018 protocol upgrade which engages canonical transaction ordering | ||||
""" | """ | ||||
import decimal | import decimal | ||||
import random | import random | ||||
import time | import time | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
# Set test to run with sigops deactivation far in the future. | |||||
SIGOPS_DEACTIVATION_TIME = 2000000000 | |||||
class CTORMiningTest(BitcoinTestFramework): | class CTORMiningTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
# Setup two nodes so we can getblocktemplate | # Setup two nodes so we can getblocktemplate | ||||
# it errors out if it is not connected to other nodes | # it errors out if it is not connected to other nodes | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.block_heights = {} | self.block_heights = {} | ||||
self.tip = None | self.tip = None | ||||
self.blocks = {} | self.blocks = {} | ||||
self.mocktime = int(time.time()) - 600 * 100 | self.mocktime = int(time.time()) - 600 * 100 | ||||
extra_arg = ['-spendzeroconfchange=0', '-whitelist=127.0.0.1'] | extra_arg = ['-spendzeroconfchange=0', '-whitelist=127.0.0.1', | ||||
'-phononactivationtime={}'.format(SIGOPS_DEACTIVATION_TIME)] | |||||
self.extra_args = [extra_arg, extra_arg] | self.extra_args = [extra_arg, extra_arg] | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
def run_test(self): | def run_test(self): | ||||
mining_node = self.nodes[0] | mining_node = self.nodes[0] | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |