diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-08-12 16:04:50 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-09-21 19:01:29 -0700 |
commit | 50f94b34a33c954f6e207f509c93d33267a5c3e2 (patch) | |
tree | 3ad8267877ba8e6e634707c79e22525b49d640ba /test/functional | |
parent | df091b9b509f0b10e4315c0bfa2da0cc0c31c22f (diff) |
[rpc] Deprecate getpeerinfo addnode field
This field is now redundant since the connection type field will indicate
MANUAL for addnode connections.
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/rpc_getpeerinfo_deprecation.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/rpc_getpeerinfo_deprecation.py b/test/functional/rpc_getpeerinfo_deprecation.py index a4c2f7ccf8..287c40ae3e 100755 --- a/test/functional/rpc_getpeerinfo_deprecation.py +++ b/test/functional/rpc_getpeerinfo_deprecation.py @@ -5,6 +5,7 @@ """Test deprecation of getpeerinfo RPC fields.""" from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import connect_nodes class GetpeerinfoDeprecationTest(BitcoinTestFramework): @@ -14,6 +15,7 @@ class GetpeerinfoDeprecationTest(BitcoinTestFramework): 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") @@ -22,5 +24,16 @@ class GetpeerinfoDeprecationTest(BitcoinTestFramework): 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"]) + connect_nodes(self.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() |