5#include <bitcoin-build-config.h>
38 settings.setValue(
"nDatabaseCache", 600);
39 settings.setValue(
"nThreadsScriptVerif", 12);
40 settings.setValue(
"fListen",
false);
41 settings.setValue(
"bPrune",
true);
42 settings.setValue(
"nPruneSize", 3);
43 settings.setValue(
"fUseProxy",
true);
44 settings.setValue(
"addrProxy",
"proxy:123");
45 settings.setValue(
"fUseSeparateProxyTor",
true);
46 settings.setValue(
"addrSeparateProxyTor",
"onion:234");
50 QVERIFY(settings.contains(
"nDatabaseCache"));
51 QVERIFY(settings.contains(
"nThreadsScriptVerif"));
52 QVERIFY(settings.contains(
"fListen"));
53 QVERIFY(settings.contains(
"bPrune"));
54 QVERIFY(settings.contains(
"nPruneSize"));
55 QVERIFY(settings.contains(
"fUseProxy"));
56 QVERIFY(settings.contains(
"addrProxy"));
57 QVERIFY(settings.contains(
"fUseSeparateProxyTor"));
58 QVERIFY(settings.contains(
"addrSeparateProxyTor"));
62 QVERIFY(options.Init(error));
63 QVERIFY(!settings.contains(
"nDatabaseCache"));
64 QVERIFY(!settings.contains(
"nThreadsScriptVerif"));
65 QVERIFY(!settings.contains(
"fListen"));
66 QVERIFY(!settings.contains(
"bPrune"));
67 QVERIFY(!settings.contains(
"nPruneSize"));
68 QVERIFY(!settings.contains(
"fUseProxy"));
69 QVERIFY(!settings.contains(
"addrProxy"));
70 QVERIFY(!settings.contains(
"fUseSeparateProxyTor"));
71 QVERIFY(!settings.contains(
"addrSeparateProxyTor"));
74 std::string default_warning =
strprintf(
"This file is automatically generated and updated by %s. Please do not edit this file while the node "
75 "is running, as any changes might be ignored or overwritten.",
77 QCOMPARE(std::string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()).c_str(),
"{\n"
78 " \"_warning_\": \""+ default_warning+
"\",\n"
79 " \"dbcache\": \"600\",\n"
80 " \"listen\": false,\n"
81 " \"onion\": \"onion:234\",\n"
83 " \"proxy\": \"proxy:123\",\n"
84 " \"prune\": \"2861\"\n"
113 s.forced_settings.erase(
"listen");
114 s.forced_settings.erase(
"listenonion");
120 settings.setValue(
"fListen",
false);
125 const bool expected{
false};
136 settings.remove(
"fListen");
137 QVERIFY(!settings.contains(
"fListen"));
143 QString filter = QString(
"Partially Signed Transaction (Binary) (*.psbt)");
146 filter = QString(
"Image (*.png *.jpg)");
fs::path GetDataDirNet() const
Get data directory path with appended network identifier.
void LockSettings(Fn &&fn)
Access settings with lock held.
void ClearPathCache()
Clear cached directory paths.
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
bool WriteSettingsFile(std::vector< std::string > *errors=nullptr, bool backup=false) const
Write settings file or backup settings file.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
common::Settings m_previous_settings
OptionTests(interfaces::Node &node)
interfaces::Node & m_node
void parametersInteraction()
Interface from Qt to configuration data structure for Bitcoin client.
Top-level interface for a bitcoin node (bitcoind process).
bool AppInitParameterInteraction(const ArgsManager &args)
Initialization: parameter interaction.
QString ExtractFirstSuffixFromFilter(const QString &filter)
Extract first suffix from filter pattern "Description (*.foo)" or "Description (*....
std::map< std::string, SettingsValue > forced_settings
Map of setting name to forced setting value.
std::map< std::string, SettingsValue > rw_settings
Map of setting name to read-write file setting value.