From 525448df9dc2ab6b7e960ff138956ae3e2efdf60 Mon Sep 17 00:00:00 2001 From: Kiminuo Date: Mon, 17 May 2021 16:38:02 +0200 Subject: Move COINBASE_MATURITY from `feature_nulldummy` test to `blocktools`. --- test/functional/feature_nulldummy.py | 9 +++++++-- test/functional/test_framework/blocktools.py | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py index c7981d31dc..02e387c7ee 100755 --- a/test/functional/feature_nulldummy.py +++ b/test/functional/feature_nulldummy.py @@ -14,13 +14,18 @@ Generate COINBASE_MATURITY (CB) more blocks to ensure the coinbases are mature. """ import time -from test_framework.blocktools import NORMAL_GBT_REQUEST_PARAMS, create_block, create_transaction, add_witness_commitment +from test_framework.blocktools import ( + COINBASE_MATURITY, + NORMAL_GBT_REQUEST_PARAMS, + add_witness_commitment, + create_block, + create_transaction, +) from test_framework.messages import CTransaction from test_framework.script import CScript from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error -COINBASE_MATURITY = 100 NULLDUMMY_ERROR = "non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)" def trueDummy(tx): diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index d08e025178..e91b44e776 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -52,6 +52,9 @@ MAX_BLOCK_SIGOPS_WEIGHT = MAX_BLOCK_SIGOPS * WITNESS_SCALE_FACTOR # Genesis block time (regtest) TIME_GENESIS_BLOCK = 1296688602 +# Coinbase transaction outputs can only be spent after this number of new blocks (network rule) +COINBASE_MATURITY = 100 + # From BIP141 WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed" -- cgit v1.2.3