Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-sigops-mempool-mining.py
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | from test_framework.util import ( | ||||
JSONRPCException | JSONRPCException | ||||
) | ) | ||||
from decimal import Decimal | from decimal import Decimal | ||||
from collections import deque | from collections import deque | ||||
SATOSHI = Decimal('0.00000001') | SATOSHI = Decimal('0.00000001') | ||||
# Set test to run with sigops deactivation far in the future. | |||||
SIGOPS_DEACTIVATION_TIME = 2000000000 | |||||
def create_var_transaction(spendfrom, custom_script, size_bytes, fee_sats): | def create_var_transaction(spendfrom, custom_script, size_bytes, fee_sats): | ||||
# Fund and sign a transaction to a given output, padding it to exactly | # Fund and sign a transaction to a given output, padding it to exactly | ||||
# size = size_bytes and providing the given fee. | # size = size_bytes and providing the given fee. | ||||
# spendfrom should be a CTransaction with first output to OP_TRUE. | # spendfrom should be a CTransaction with first output to OP_TRUE. | ||||
customout = CTxOut(0, custom_script) | customout = CTxOut(0, custom_script) | ||||
# set output amount to required dust | # set output amount to required dust | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | def create_var_transaction(spendfrom, custom_script, size_bytes, fee_sats): | ||||
return ctx | return ctx | ||||
class MempoolLimitSigopsTest(BitcoinTestFramework): | class MempoolLimitSigopsTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [["-maxmempool=5"]] | self.extra_args = [ | ||||
["-maxmempool=5", '-phononactivationtime={}'.format(SIGOPS_DEACTIVATION_TIME)]] | |||||
self.block_heights = {} | self.block_heights = {} | ||||
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 getbestblock(self, node): | def getbestblock(self, node): | ||||
"""Get the best block. Register its height so we can use build_block.""" | """Get the best block. Register its height so we can use build_block.""" | ||||
block_height = node.getblockcount() | block_height = node.getblockcount() | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |