aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2024-01-09 10:25:08 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2024-01-22 10:50:03 -0300
commite9014042a6bed8c16cc9a31fc35cb709d4b3c766 (patch)
treea031e1bf1d456af105ef757ee5ff9318be5299a2 /test/functional
parent966f5de99a9f5da05c91378ad1e8ea8ed37ac3b3 (diff)
downloadbitcoin-e9014042a6bed8c16cc9a31fc35cb709d4b3c766.tar.xz
settings: add auto-generated warning msg for editing the file manually
Hopefully, refraining users from modifying the file unless they are certain about the potential consequences. Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/feature_settings.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/feature_settings.py b/test/functional/feature_settings.py
index 4175699152..0214e781de 100755
--- a/test/functional/feature_settings.py
+++ b/test/functional/feature_settings.py
@@ -23,10 +23,11 @@ class SettingsTest(BitcoinTestFramework):
settings = node.chain_path / "settings.json"
conf = node.datadir_path / "bitcoin.conf"
- # Assert empty settings file was created
+ # Assert default settings file was created
self.stop_node(0)
+ default_settings = {"_warning_": "This file is automatically generated and updated by Bitcoin Core. Please do not edit this file while the node is running, as any changes might be ignored or overwritten."}
with settings.open() as fp:
- assert_equal(json.load(fp), {})
+ assert_equal(json.load(fp), default_settings)
# Assert settings are parsed and logged
with settings.open("w") as fp:
@@ -48,7 +49,7 @@ class SettingsTest(BitcoinTestFramework):
# Assert settings are unchanged after shutdown
with settings.open() as fp:
- assert_equal(json.load(fp), {"string": "string", "num": 5, "bool": True, "null": None, "list": [6, 7]})
+ assert_equal(json.load(fp), {**default_settings, **{"string": "string", "num": 5, "bool": True, "null": None, "list": [6, 7]}})
# Test invalid json
with settings.open("w") as fp: