test: Activate all regtest softforks at height 1, unless overridden

This commit is contained in:
MarcoFalke
2021-08-27 16:53:11 +02:00
parent faad1e5ffd
commit fa4db8671b
13 changed files with 52 additions and 44 deletions

View File

@ -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"

View File

@ -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