aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-07-08 12:33:14 +0200
committerJon Atack <jon@atack.com>2020-07-08 13:14:50 +0200
commitdd54e3796e633cfdf6954af306afd26eadc25116 (patch)
tree1ae99eeee161e52cb2a414d40eff8a61b3ba7775 /test
parent8c7647b3fbbab03ea84071cf3cd2d0d2bf8be255 (diff)
test: getpeerinfo banscore deprecation test
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_getpeerinfo_banscore_deprecation.py24
-rwxr-xr-xtest/functional/test_runner.py1
2 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/rpc_getpeerinfo_banscore_deprecation.py b/test/functional/rpc_getpeerinfo_banscore_deprecation.py
new file mode 100755
index 0000000000..b830248e1e
--- /dev/null
+++ b/test/functional/rpc_getpeerinfo_banscore_deprecation.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+# Copyright (c) 2020 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+"""Test deprecation of getpeerinfo RPC banscore field."""
+
+from test_framework.test_framework import BitcoinTestFramework
+
+
+class GetpeerinfoBanscoreDeprecationTest(BitcoinTestFramework):
+ def set_test_params(self):
+ self.num_nodes = 2
+ self.extra_args = [[], ["-deprecatedrpc=banscore"]]
+
+ def run_test(self):
+ self.log.info("Test getpeerinfo by default no longer returns a banscore field")
+ assert "banscore" not in self.nodes[0].getpeerinfo()[0].keys()
+
+ self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
+ assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
+
+
+if __name__ == "__main__":
+ GetpeerinfoBanscoreDeprecationTest().main()
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 2fa48006f4..6deba9a9ec 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -243,6 +243,7 @@ BASE_SCRIPTS = [
'feature_blocksdir.py',
'feature_config_args.py',
'rpc_getdescriptorinfo.py',
+ 'rpc_getpeerinfo_banscore_deprecation.py',
'rpc_help.py',
'feature_help.py',
'feature_shutdown.py',