mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 01:33:20 +02:00
Merge bitcoin/bitcoin#15936: interfaces: Expose settings.json methods to GUI
f9fdcec7e9settings: Add resetSettings() method (Ryan Ofsky)77fabffef4init: Remove Shutdown() node.args reset (Ryan Ofsky)0e55bc6e7fsettings: Add update/getPersistent/isIgnored methods (Ryan Ofsky) Pull request description: Add `interfaces::Node` `updateSetting`, `forceSetting`, `resetSettings`, `isSettingIgnored`, and `getPersistentSetting` methods so GUI is able to manipulate `settings.json` file and use and modify node settings. (Originally this PR also contained GUI changes to unify bitcoin-qt and bitcoind persistent settings and call these methods, but the GUI commits have been dropped from this PR and moved to bitcoin-core/gui/pull/602) ACKs for top commit: vasild: ACKf9fdcec7e9hebasto: re-ACKf9fdcec7e9, only a function renamed since my recent [review](https://github.com/bitcoin/bitcoin/pull/15936#pullrequestreview-979324357). Tree-SHA512: 4cac853ee29be96d2ff38404165b9dfb7c622b2a9c99a15979596f3484ffde0da3d9c9c372677dff5119ca7cffa6383d81037fd9889a29cc9285882a8dc0c268
This commit is contained in:
@@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(ReadWrite)
|
||||
//! Check settings struct contents against expected json strings.
|
||||
static void CheckValues(const util::Settings& settings, const std::string& single_val, const std::string& list_val)
|
||||
{
|
||||
util::SettingsValue single_value = GetSetting(settings, "section", "name", false, false);
|
||||
util::SettingsValue single_value = GetSetting(settings, "section", "name", false, false, false);
|
||||
util::SettingsValue list_value(util::SettingsValue::VARR);
|
||||
for (const auto& item : GetSettingsList(settings, "section", "name", false)) {
|
||||
list_value.push_back(item);
|
||||
@@ -141,9 +141,9 @@ BOOST_AUTO_TEST_CASE(NullOverride)
|
||||
{
|
||||
util::Settings settings;
|
||||
settings.command_line_options["name"].push_back("value");
|
||||
BOOST_CHECK_EQUAL(R"("value")", GetSetting(settings, "section", "name", false, false).write().c_str());
|
||||
BOOST_CHECK_EQUAL(R"("value")", GetSetting(settings, "section", "name", false, false, false).write().c_str());
|
||||
settings.forced_settings["name"] = {};
|
||||
BOOST_CHECK_EQUAL(R"(null)", GetSetting(settings, "section", "name", false, false).write().c_str());
|
||||
BOOST_CHECK_EQUAL(R"(null)", GetSetting(settings, "section", "name", false, false, false).write().c_str());
|
||||
}
|
||||
|
||||
// Test different ways settings can be merged, and verify results. This test can
|
||||
@@ -224,7 +224,7 @@ BOOST_FIXTURE_TEST_CASE(Merge, MergeTestingSetup)
|
||||
}
|
||||
|
||||
desc += " || ";
|
||||
desc += GetSetting(settings, network, name, ignore_default_section_config, /* get_chain_name= */ false).write();
|
||||
desc += GetSetting(settings, network, name, ignore_default_section_config, /*ignore_nonpersistent=*/false, /*get_chain_name=*/false).write();
|
||||
desc += " |";
|
||||
for (const auto& s : GetSettingsList(settings, network, name, ignore_default_section_config)) {
|
||||
desc += " ";
|
||||
|
||||
Reference in New Issue
Block a user