Skip to content

Commit dd54e37

Browse files
committed
test: getpeerinfo banscore deprecation test
1 parent 8c7647b commit dd54e37

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2020 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
"""Test deprecation of getpeerinfo RPC banscore field."""
6+
7+
from test_framework.test_framework import BitcoinTestFramework
8+
9+
10+
class GetpeerinfoBanscoreDeprecationTest(BitcoinTestFramework):
11+
def set_test_params(self):
12+
self.num_nodes = 2
13+
self.extra_args = [[], ["-deprecatedrpc=banscore"]]
14+
15+
def run_test(self):
16+
self.log.info("Test getpeerinfo by default no longer returns a banscore field")
17+
assert "banscore" not in self.nodes[0].getpeerinfo()[0].keys()
18+
19+
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
20+
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
21+
22+
23+
if __name__ == "__main__":
24+
GetpeerinfoBanscoreDeprecationTest().main()

test/functional/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
'feature_blocksdir.py',
244244
'feature_config_args.py',
245245
'rpc_getdescriptorinfo.py',
246+
'rpc_getpeerinfo_banscore_deprecation.py',
246247
'rpc_help.py',
247248
'feature_help.py',
248249
'feature_shutdown.py',

0 commit comments

Comments
 (0)