Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-p2p-fullblocktest-sigops.py
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | from test_framework.script import ( | ||||
OP_TRUE, | OP_TRUE, | ||||
SIGHASH_ALL, | SIGHASH_ALL, | ||||
SIGHASH_FORKID, | SIGHASH_FORKID, | ||||
SignatureHashForkId, | SignatureHashForkId, | ||||
) | ) | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import assert_equal | from test_framework.util import assert_equal | ||||
# Set test to run with sigops deactivation far in the future. | |||||
SIGOPS_DEACTIVATION_TIME = 2000000000 | |||||
class PreviousSpendableOutput(): | class PreviousSpendableOutput(): | ||||
def __init__(self, tx=CTransaction(), n=-1): | def __init__(self, tx=CTransaction(), n=-1): | ||||
self.tx = tx | self.tx = tx | ||||
# the output we're spending | # the output we're spending | ||||
self.n = n | self.n = n | ||||
class FullBlockTest(BitcoinTestFramework): | class FullBlockTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
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.excessive_block_size = 100 * ONE_MEGABYTE | self.excessive_block_size = 100 * ONE_MEGABYTE | ||||
self.extra_args = [['-whitelist=127.0.0.1', | self.extra_args = [['-whitelist=127.0.0.1', | ||||
"-excessiveblocksize={}".format(self.excessive_block_size)]] | "-excessiveblocksize={}".format(self.excessive_block_size), '-phononactivationtime={}'.format(SIGOPS_DEACTIVATION_TIME)]] | ||||
def add_options(self, parser): | def add_options(self, parser): | ||||
super().add_options(parser) | super().add_options(parser) | ||||
parser.add_argument( | parser.add_argument( | ||||
"--runbarelyexpensive", dest="runbarelyexpensive", default=True) | "--runbarelyexpensive", dest="runbarelyexpensive", default=True) | ||||
def add_transactions_to_block(self, block, tx_list): | def add_transactions_to_block(self, block, tx_list): | ||||
[tx.rehash() for tx in tx_list] | [tx.rehash() for tx in tx_list] | ||||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |