File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
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 ()
Original file line number Diff line number Diff line change 243
243
'feature_blocksdir.py' ,
244
244
'feature_config_args.py' ,
245
245
'rpc_getdescriptorinfo.py' ,
246
+ 'rpc_getpeerinfo_banscore_deprecation.py' ,
246
247
'rpc_help.py' ,
247
248
'feature_help.py' ,
248
249
'feature_shutdown.py' ,
You can’t perform that action at this time.
0 commit comments