@@ -648,23 +648,18 @@ BOOST_AUTO_TEST_CASE(util_GetChainTypeString)
648
648
const auto regtest = std::make_pair (" -regtest" , ArgsManager::ALLOW_ANY);
649
649
test_args.SetupArgs ({testnet, testnet4, regtest});
650
650
651
- const char * argv_testnet[] = {" cmd" , " -testnet" };
652
651
const char * argv_testnet4[] = {" cmd" , " -testnet4" };
653
652
const char * argv_regtest[] = {" cmd" , " -regtest" };
654
- const char * argv_test_no_reg[] = {" cmd" , " -testnet " , " -noregtest" };
655
- const char * argv_both[] = {" cmd" , " -testnet " , " -regtest" };
653
+ const char * argv_test_no_reg[] = {" cmd" , " -testnet4 " , " -noregtest" };
654
+ const char * argv_both[] = {" cmd" , " -testnet4 " , " -regtest" };
656
655
657
- // equivalent to "-testnet"
658
- // regtest in testnet section is ignored
659
- const char * testnetconf = " testnet=1\n regtest=0\n [test]\n regtest=1" ;
656
+ // regtest in test network section is ignored
657
+ const char * testnetconf = " testnet4=1\n regtest=0\n [testnet4]\n regtest=1" ;
660
658
std::string error;
661
659
662
- BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet , error));
660
+ BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet4 , error));
663
661
BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " main" );
664
662
665
- BOOST_CHECK (test_args.ParseParameters (2 , argv_testnet, error));
666
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test" );
667
-
668
663
BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet4, error));
669
664
BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " main" );
670
665
@@ -675,50 +670,50 @@ BOOST_AUTO_TEST_CASE(util_GetChainTypeString)
675
670
BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " regtest" );
676
671
677
672
BOOST_CHECK (test_args.ParseParameters (3 , argv_test_no_reg, error));
678
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
673
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
679
674
680
675
BOOST_CHECK (test_args.ParseParameters (3 , argv_both, error));
681
676
BOOST_CHECK_THROW (test_args.GetChainTypeString (), std::runtime_error);
682
677
683
- BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet , error));
678
+ BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet4 , error));
684
679
test_args.ReadConfigString (testnetconf);
685
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
680
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
686
681
687
- BOOST_CHECK (test_args.ParseParameters (2 , argv_testnet , error));
682
+ BOOST_CHECK (test_args.ParseParameters (2 , argv_testnet4 , error));
688
683
test_args.ReadConfigString (testnetconf);
689
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
684
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
690
685
691
686
BOOST_CHECK (test_args.ParseParameters (2 , argv_regtest, error));
692
687
test_args.ReadConfigString (testnetconf);
693
688
BOOST_CHECK_THROW (test_args.GetChainTypeString (), std::runtime_error);
694
689
695
690
BOOST_CHECK (test_args.ParseParameters (3 , argv_test_no_reg, error));
696
691
test_args.ReadConfigString (testnetconf);
697
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
692
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
698
693
699
694
BOOST_CHECK (test_args.ParseParameters (3 , argv_both, error));
700
695
test_args.ReadConfigString (testnetconf);
701
696
BOOST_CHECK_THROW (test_args.GetChainTypeString (), std::runtime_error);
702
697
703
- // check setting the network to test (and thus making
704
- // [test ] regtest=1 potentially relevant) doesn't break things
705
- test_args.SelectConfigNetwork (" test " );
698
+ // check setting the network to testnet4 (and thus making
699
+ // [testnet4 ] regtest=1 potentially relevant) doesn't break things
700
+ test_args.SelectConfigNetwork (" testnet4 " );
706
701
707
- BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet , error));
702
+ BOOST_CHECK (test_args.ParseParameters (0 , argv_testnet4 , error));
708
703
test_args.ReadConfigString (testnetconf);
709
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
704
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
710
705
711
- BOOST_CHECK (test_args.ParseParameters (2 , argv_testnet , error));
706
+ BOOST_CHECK (test_args.ParseParameters (2 , argv_testnet4 , error));
712
707
test_args.ReadConfigString (testnetconf);
713
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
708
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
714
709
715
710
BOOST_CHECK (test_args.ParseParameters (2 , argv_regtest, error));
716
711
test_args.ReadConfigString (testnetconf);
717
712
BOOST_CHECK_THROW (test_args.GetChainTypeString (), std::runtime_error);
718
713
719
714
BOOST_CHECK (test_args.ParseParameters (2 , argv_test_no_reg, error));
720
715
test_args.ReadConfigString (testnetconf);
721
- BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " test " );
716
+ BOOST_CHECK_EQUAL (test_args.GetChainTypeString (), " testnet4 " );
722
717
723
718
BOOST_CHECK (test_args.ParseParameters (3 , argv_both, error));
724
719
test_args.ReadConfigString (testnetconf);
@@ -739,7 +734,7 @@ BOOST_AUTO_TEST_CASE(util_GetChainTypeString)
739
734
//
740
735
// - Combining SoftSet and ForceSet calls.
741
736
//
742
- // - Testing "main" and "test " network values to make sure settings from network
737
+ // - Testing "main" and "testnet4 " network values to make sure settings from network
743
738
// sections are applied and to check for mainnet-specific behaviors like
744
739
// inheriting settings from the default section.
745
740
//
@@ -956,11 +951,11 @@ BOOST_FIXTURE_TEST_CASE(util_ChainMerge, ChainMergeTestingSetup)
956
951
TestArgsManager parser;
957
952
LOCK (parser.cs_args );
958
953
parser.AddArg (" -regtest" , " regtest" , ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
959
- parser.AddArg (" -testnet " , " testnet " , ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
954
+ parser.AddArg (" -testnet4 " , " testnet4 " , ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
960
955
961
- auto arg = [](Action action) { return action == ENABLE_TEST ? " -testnet =1" :
962
- action == DISABLE_TEST ? " -testnet =0" :
963
- action == NEGATE_TEST ? " -notestnet =1" :
956
+ auto arg = [](Action action) { return action == ENABLE_TEST ? " -testnet4 =1" :
957
+ action == DISABLE_TEST ? " -testnet4 =0" :
958
+ action == NEGATE_TEST ? " -notestnet4 =1" :
964
959
action == ENABLE_REG ? " -regtest=1" :
965
960
action == DISABLE_REG ? " -regtest=0" :
966
961
action == NEGATE_REG ? " -noregtest=1" : nullptr ; };
@@ -1024,7 +1019,7 @@ BOOST_FIXTURE_TEST_CASE(util_ChainMerge, ChainMergeTestingSetup)
1024
1019
// Results file is formatted like:
1025
1020
//
1026
1021
// <input> || <output>
1027
- BOOST_CHECK_EQUAL (out_sha_hex, " 9e60306e1363528bbc19a47f22bcede88e5d6815212f18ec8e6cdc4638dddab4 " );
1022
+ BOOST_CHECK_EQUAL (out_sha_hex, " c0e33aab0c74e040ddcee9edad59e8148d8e1cacb3cccd9ea1a1f485cb6bad21 " );
1028
1023
}
1029
1024
1030
1025
BOOST_AUTO_TEST_CASE (util_ReadWriteSettings)
0 commit comments