mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge bitcoin/bitcoin#22818: test: Activate all regtest softforks at height 1, unless overridden
fa4db8671btest: Activate all regtest softforks at height 1, unless overridden (MarcoFalke)faad1e5ffdIntroduce -testactivationheight=name@height setting (MarcoFalke)fadb2ef2fatest: Add extra_args argument to TestChain100Setup constructor (MarcoFalke)faa46986aatest: Remove version argument from build_next_block in p2p_segwit test (MarcoFalke)fa086ef539test: Remove unused ~TestChain100Setup (MarcoFalke) Pull request description: All softforks that are active at the tip of mainnet, should also be active from genesis in regtest. Otherwise their rules might not be enforced in user testing, thus making their testing less useful. To still allow tests to check pre-softfork rules, a runtime argument can change the activation height. ACKs for top commit: laanwj: Code review ACKfa4db8671btheStack: re-ACKfa4db8671bTree-SHA512: 6397d46ff56ebc48c007a4cda633904d6ac085bc76b4ecf83097c546c7eec93ac0c44b88083b2611b9091c8d1fb8ee1e314065de078ef15e922c015de7ade8bf
This commit is contained in:
@@ -53,11 +53,6 @@ TIME_GENESIS_BLOCK = 1296688602
|
||||
# Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
|
||||
COINBASE_MATURITY = 100
|
||||
|
||||
# Soft-fork activation heights
|
||||
DERSIG_HEIGHT = 102 # BIP 66
|
||||
CLTV_HEIGHT = 111 # BIP 65
|
||||
CSV_ACTIVATION_HEIGHT = 432
|
||||
|
||||
# From BIP141
|
||||
WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed"
|
||||
|
||||
|
||||
@@ -560,17 +560,6 @@ def mine_large_block(test_framework, node, utxos=None):
|
||||
test_framework.generate(node, 1)
|
||||
|
||||
|
||||
def generate_to_height(test_framework, node, target_height):
|
||||
"""Generates blocks until a given target block height has been reached.
|
||||
To prevent timeouts, only up to 200 blocks are generated per RPC call.
|
||||
Can be used to activate certain soft-forks (e.g. CSV, CLTV)."""
|
||||
current_height = node.getblockcount()
|
||||
while current_height < target_height:
|
||||
nblocks = min(200, target_height - current_height)
|
||||
current_height += len(test_framework.generate(node, nblocks))
|
||||
assert_equal(node.getblockcount(), target_height)
|
||||
|
||||
|
||||
def find_vout_for_address(node, txid, addr):
|
||||
"""
|
||||
Locate the vout index of the given transaction sending to the
|
||||
|
||||
Reference in New Issue
Block a user