Merge #20755: [rpc] Remove deprecated fields from getpeerinfo
pull/826/head454a4088a8
[doc] Add release notes for removed getpeerinfo fields. (Amiti Uttarwar)b1a936d4ae
[rpc] Remove deprecated "whitelisted" field from getpeerinfo (Amiti Uttarwar)094c3beaa4
[rpc] Remove deprecated "banscore" field from getpeerinfo (Amiti Uttarwar)537053336f
[rpc] Remove deprecated "addnode" field from getpeerinfo (Amiti Uttarwar) Pull request description: This PR removes support for 3 fields on the `getpeerinfo` RPC that were deprecated in v0.21- `addnode`, `banscore` & `whitelisted`. ACKs for top commit: sipa: utACK454a4088a8
jnewbery: ACK454a4088a8
. Tree-SHA512: ccc0e90c0763eeb8529cf0c46162dbaca3f7773981b3b52d9925166ea7421aed086795d56b320e16c9340f68862388785f52a9b78314865070917b33180d7cd6
commit
e3dd0a56cf
@ -1,38 +0,0 @@
|
||||
#!/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 fields."""
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
|
||||
|
||||
class GetpeerinfoDeprecationTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 2
|
||||
self.extra_args = [[], ["-deprecatedrpc=banscore"]]
|
||||
|
||||
def run_test(self):
|
||||
self.test_banscore_deprecation()
|
||||
self.test_addnode_deprecation()
|
||||
|
||||
def test_banscore_deprecation(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()
|
||||
|
||||
def test_addnode_deprecation(self):
|
||||
self.restart_node(1, ["-deprecatedrpc=getpeerinfo_addnode"])
|
||||
self.connect_nodes(0, 1)
|
||||
|
||||
self.log.info("Test getpeerinfo by default no longer returns an addnode field")
|
||||
assert "addnode" not in self.nodes[0].getpeerinfo()[0].keys()
|
||||
|
||||
self.log.info("Test getpeerinfo returns addnode with -deprecatedrpc=addnode")
|
||||
assert "addnode" in self.nodes[1].getpeerinfo()[0].keys()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
GetpeerinfoDeprecationTest().main()
|
Loading…
Reference in new issue