mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: drop testnet3 coverage
Except for the deprecation warning in feature_config_args.py. This test now writes its own config file, which was previously done by test_acceptstalefeeestimates_arg_support. The deprecation warning test will be removed in a later commit.
This commit is contained in:
parent
7536be28ba
commit
5cb1738951
5 changed files with 12 additions and 13 deletions
|
@ -643,10 +643,9 @@ BOOST_AUTO_TEST_CASE(util_GetArg)
|
|||
BOOST_AUTO_TEST_CASE(util_GetChainTypeString)
|
||||
{
|
||||
TestArgsManager test_args;
|
||||
const auto testnet = std::make_pair("-testnet", ArgsManager::ALLOW_ANY);
|
||||
const auto testnet4 = std::make_pair("-testnet4", ArgsManager::ALLOW_ANY);
|
||||
const auto regtest = std::make_pair("-regtest", ArgsManager::ALLOW_ANY);
|
||||
test_args.SetupArgs({testnet, testnet4, regtest});
|
||||
test_args.SetupArgs({testnet4, regtest});
|
||||
|
||||
const char* argv_testnet4[] = {"cmd", "-testnet4"};
|
||||
const char* argv_regtest[] = {"cmd", "-regtest"};
|
||||
|
@ -761,8 +760,8 @@ struct ArgsMergeTestingSetup : public BasicTestingSetup {
|
|||
ForEachNoDup(conf_actions, SET, SECTION_NEGATE, [&] {
|
||||
for (bool soft_set : {false, true}) {
|
||||
for (bool force_set : {false, true}) {
|
||||
for (const std::string& section : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) {
|
||||
for (const std::string& network : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) {
|
||||
for (const std::string& section : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) {
|
||||
for (const std::string& network : {ChainTypeToString(ChainType::MAIN), ChainTypeToString(ChainType::TESTNET4), ChainTypeToString(ChainType::SIGNET)}) {
|
||||
for (bool net_specific : {false, true}) {
|
||||
fn(arg_actions, conf_actions, soft_set, force_set, section, network, net_specific);
|
||||
}
|
||||
|
@ -916,7 +915,7 @@ BOOST_FIXTURE_TEST_CASE(util_ArgsMerge, ArgsMergeTestingSetup)
|
|||
// Results file is formatted like:
|
||||
//
|
||||
// <input> || <IsArgSet/IsArgNegated/GetArg output> | <GetArgs output> | <GetUnsuitable output>
|
||||
BOOST_CHECK_EQUAL(out_sha_hex, "f1ee5ab094cc43d16a6086fa7f2c10389e0f99902616b31bbf29189972ad1473");
|
||||
BOOST_CHECK_EQUAL(out_sha_hex, "4255a9ad78d2a68341750bf2de61131ef5610808b6e37b6f546222ca7342f36a");
|
||||
}
|
||||
|
||||
// Similar test as above, but for ArgsManager::GetChainTypeString function.
|
||||
|
|
|
@ -137,7 +137,7 @@ BOOST_AUTO_TEST_CASE(key_io_invalid)
|
|||
std::string exp_base58string = test[0].get_str();
|
||||
|
||||
// must be invalid as public and as private key
|
||||
for (const auto& chain : {ChainType::MAIN, ChainType::TESTNET, ChainType::SIGNET, ChainType::REGTEST}) {
|
||||
for (const auto& chain : {ChainType::MAIN, ChainType::SIGNET, ChainType::REGTEST}) {
|
||||
SelectParams(chain);
|
||||
destination = DecodeDestination(exp_base58string);
|
||||
BOOST_CHECK_MESSAGE(!IsValidDestination(destination), "IsValid pubkey in mainnet:" + strTest);
|
||||
|
|
|
@ -193,11 +193,6 @@ BOOST_AUTO_TEST_CASE(ChainParams_REGTEST_sanity)
|
|||
sanity_check_chainparams(*m_node.args, ChainType::REGTEST);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ChainParams_TESTNET_sanity)
|
||||
{
|
||||
sanity_check_chainparams(*m_node.args, ChainType::TESTNET);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ChainParams_TESTNET4_sanity)
|
||||
{
|
||||
sanity_check_chainparams(*m_node.args, ChainType::TESTNET4);
|
||||
|
|
|
@ -424,7 +424,7 @@ BOOST_FIXTURE_TEST_CASE(versionbits_computeblockversion, BlockVersionTest)
|
|||
|
||||
// check that any deployment on any chain can conceivably reach both
|
||||
// ACTIVE and FAILED states in roughly the way we expect
|
||||
for (const auto& chain_type: {ChainType::MAIN, ChainType::TESTNET, ChainType::TESTNET4, ChainType::SIGNET, ChainType::REGTEST}) {
|
||||
for (const auto& chain_type: {ChainType::MAIN, ChainType::TESTNET4, ChainType::SIGNET, ChainType::REGTEST}) {
|
||||
const auto chainParams = CreateChainParams(*m_node.args, chain_type);
|
||||
uint32_t chain_all_vbits{0};
|
||||
for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++i) {
|
||||
|
|
|
@ -465,7 +465,7 @@ class ConfArgsTest(BitcoinTestFramework):
|
|||
def test_acceptstalefeeestimates_arg_support(self):
|
||||
self.log.info("Test -acceptstalefeeestimates option support")
|
||||
conf_file = self.nodes[0].datadir_path / "bitcoin.conf"
|
||||
for chain, chain_name in {("main", ""), ("test", "testnet3"), ("signet", "signet"), ("testnet4", "testnet4")}:
|
||||
for chain, chain_name in {("main", ""), ("signet", "signet"), ("testnet4", "testnet4")}:
|
||||
util.write_config(conf_file, n=0, chain=chain_name, extra_config='acceptstalefeeestimates=1\n')
|
||||
self.nodes[0].assert_start_raises_init_error(expected_msg=f'Error: acceptstalefeeestimates is not supported on {chain} chain.')
|
||||
util.write_config(conf_file, n=0, chain="regtest") # Reset to regtest
|
||||
|
@ -476,6 +476,11 @@ class ConfArgsTest(BitcoinTestFramework):
|
|||
|
||||
self.log.debug("Testnet3 node will log the deprecation warning")
|
||||
self.nodes[0].chain = 'testnet3'
|
||||
# Ensure a log file exists as TestNode.assert_debug_log() expects it.
|
||||
self.nodes[0].debug_log_path.parent.mkdir()
|
||||
self.nodes[0].debug_log_path.touch()
|
||||
util.write_config(self.nodes[0].datadir_path / "bitcoin.conf", n=0, chain="testnet3")
|
||||
|
||||
self.nodes[0].replace_in_config([('regtest=', 'testnet='), ('[regtest]', '[test]')])
|
||||
with self.nodes[0].assert_debug_log([t3_warning_log]):
|
||||
self.start_node(0)
|
||||
|
|
Loading…
Add table
Reference in a new issue