From 7856df27331cc56b4783052f5c0cecd7cc3d4b16 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Mon, 24 Apr 2023 08:30:36 +0000 Subject: [PATCH] test: elements fixes for Bitcoin PR bitcoin/bitcoin#22818 --- src/chainparams.cpp | 2 +- src/test/util/setup_common.cpp | 2 +- test/functional/feature_bip68_sequence.py | 2 ++ test/functional/feature_block.py | 1 + test/functional/feature_cltv.py | 1 + test/functional/feature_dersig.py | 1 + test/functional/test_framework/util.py | 6 +++--- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 06e5f1a87b..e289edd705 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -769,7 +769,7 @@ protected: consensus.BIP34Hash = uint256S(args.GetArg("-con_bip34hash", "0x0")); consensus.BIP65Height = args.GetArg("-con_bip65height", 0); consensus.BIP66Height = args.GetArg("-con_bip66height", 0); - consensus.CSVHeight = args.GetArg("-con_csv_deploy_start", 432); + consensus.CSVHeight = args.GetArg("-con_csv_deploy_start", 1); consensus.powLimit = uint256S(args.GetArg("-con_powlimit", "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); consensus.nPowTargetTimespan = args.GetArg("-con_npowtargettimespan", consensus.nPowTargetTimespan); consensus.nPowTargetSpacing = args.GetArg("-con_npowtargetspacing", consensus.nPowTargetSpacing); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index d564353c95..8870be63f4 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -231,7 +231,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::string& fedp } TestChain100Setup::TestChain100Setup(const std::vector& extra_args) - : TestingSetup{CBaseChainParams::REGTEST, extra_args} + : TestingSetup{CBaseChainParams::REGTEST, "", extra_args} // ELEMENTS: added empty fedpegscript here { SetMockTime(1598887952); constexpr std::array vchKey = { diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py index e2fc8beaf0..24fec4aded 100755 --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -45,10 +45,12 @@ class BIP68Test(BitcoinTestFramework): [ '-testactivationheight=csv@432', "-acceptnonstdtxn=1", + "-con_csv_deploy_start=432", # ELEMENTS ], [ '-testactivationheight=csv@432', "-acceptnonstdtxn=0", + "-con_csv_deploy_start=432", # ELEMENTS ], ] diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index 5078d27ddc..78db2ecc15 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -85,6 +85,7 @@ class FullBlockTest(BitcoinTestFramework): self.extra_args = [[ '-acceptnonstdtxn=1', # This is a consensus block test, we don't care about tx policy '-testactivationheight=bip34@2', + "-con_bip34height=2", # ELEMENTS ]] def run_test(self): diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index 3dc858f5d2..ecdbf1b317 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -86,6 +86,7 @@ class BIP65Test(BitcoinTestFramework): '-whitelist=noban@127.0.0.1', '-par=1', # Use only one script thread to get the exact reject reason for testing '-acceptnonstdtxn=1', # cltv_invalidate is nonstandard + f'-con_bip65height={CLTV_HEIGHT}', # ELEMENTS ]] self.setup_clean_chain = True self.rpc_timeout = 480 diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index 28aff1f2f9..4bb1958066 100755 --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -51,6 +51,7 @@ class BIP66Test(BitcoinTestFramework): f'-testactivationheight=dersig@{DERSIG_HEIGHT}', '-whitelist=noban@127.0.0.1', '-par=1', # Use only one script thread to get the exact log msg for testing + f'-con_bip66height={DERSIG_HEIGHT}', # ELEMENTS ]] self.setup_clean_chain = True self.rpc_timeout = 240 diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 577e4d3b47..b1dee23524 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -396,9 +396,9 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect= f.write("con_connect_genesis_outputs=0\n") f.write("anyonecanspendaremine=0\n") f.write("walletrbf=0\n") # Default is 1 in Elements - f.write("con_bip34height=2\n") - f.write("con_bip65height=111\n") - f.write("con_bip66height=102\n") + f.write("con_bip34height=1\n") + f.write("con_bip65height=1\n") + f.write("con_bip66height=1\n") f.write("blindedaddresses=0\n") # Set to minimize broken tests in favor of custom f.write("evbparams=dynafed:"+str(2**31)+":::\n") # Never starts unless overridden f.write("minrelaytxfee=0.00001\n")