Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p-fullblocktest.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-2016 The Bitcoin Core developers | ||||
# Copyright (c) 2017 The Bitcoin developers | # Copyright (c) 2017 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. | ||||
from test_framework.test_framework import ComparisonTestFramework | from test_framework.test_framework import ComparisonTestFramework | ||||
from test_framework.decorators import * | |||||
from test_framework.util import * | from test_framework.util import * | ||||
from test_framework.comptool import TestManager, TestInstance, RejectResult | from test_framework.comptool import TestManager, TestInstance, RejectResult | ||||
from test_framework.blocktools import * | from test_framework.blocktools import * | ||||
import time | import time | ||||
from test_framework.key import CECKey | from test_framework.key import CECKey | ||||
from test_framework.script import * | from test_framework.script import * | ||||
import struct | import struct | ||||
from test_framework.cdefs import LEGACY_MAX_BLOCK_SIZE, MAX_BLOCK_SIGOPS_PER_MB | from test_framework.cdefs import LEGACY_MAX_BLOCK_SIZE, MAX_BLOCK_SIGOPS_PER_MB | ||||
Show All 35 Lines | def serialize(self): | ||||
return r | return r | ||||
def normal_serialize(self): | def normal_serialize(self): | ||||
r = b"" | r = b"" | ||||
r += super(CBrokenBlock, self).serialize() | r += super(CBrokenBlock, self).serialize() | ||||
return r | return r | ||||
@extended | |||||
class FullBlockTest(ComparisonTestFramework): | class FullBlockTest(ComparisonTestFramework): | ||||
# Can either run this test as 1 node with expected answers, or two and compare them. | # Can either run this test as 1 node with expected answers, or two and compare them. | ||||
# Change the "outcome" variable from each TestInstance object to only do the comparison. | # Change the "outcome" variable from each TestInstance object to only do the comparison. | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [['-whitelist=127.0.0.1', | self.extra_args = [['-whitelist=127.0.0.1', | ||||
'-noparkdeepreorg', '-maxreorgdepth=-1']] | '-noparkdeepreorg', '-maxreorgdepth=-1']] | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
▲ Show 20 Lines • Show All 1,247 Lines • Show Last 20 Lines |