Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-mempool-accept-txn.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | from test_framework.script import ( | ||||
SignatureHashForkId, | SignatureHashForkId, | ||||
) | ) | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import assert_equal, assert_raises_rpc_error | from test_framework.util import assert_equal, assert_raises_rpc_error | ||||
# Error for too many sigops in one TX | # Error for too many sigops in one TX | ||||
RPC_TXNS_TOO_MANY_SIGOPS_ERROR = "bad-txns-too-many-sigops" | RPC_TXNS_TOO_MANY_SIGOPS_ERROR = "bad-txns-too-many-sigops" | ||||
# 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.coinbase_key = CECKey() | self.coinbase_key = CECKey() | ||||
self.coinbase_key.set_secretbytes(b"horsebattery") | self.coinbase_key.set_secretbytes(b"horsebattery") | ||||
self.coinbase_pubkey = self.coinbase_key.get_pubkey() | self.coinbase_pubkey = self.coinbase_key.get_pubkey() | ||||
self.tip = None | self.tip = None | ||||
self.blocks = {} | self.blocks = {} | ||||
self.extra_args = [ | |||||
['-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 195 Lines • Show Last 20 Lines |