diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2020-08-20 18:42:54 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2020-10-14 14:16:42 +0000 |
commit | d681a28219d3876a2b6e3cd2fb0d92963674903e (patch) | |
tree | ac1da24af138b3f755ea3ebe109ac9bd07a6fcf1 /test/functional/p2p_permissions.py | |
parent | 99a1d572eabca89790216b3919a237e07063a376 (diff) | |
download | bitcoin-d681a28219d3876a2b6e3cd2fb0d92963674903e.tar.xz |
RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions")
Diffstat (limited to 'test/functional/p2p_permissions.py')
-rwxr-xr-x | test/functional/p2p_permissions.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py index 3ec36edb41..d7b10cb075 100755 --- a/test/functional/p2p_permissions.py +++ b/test/functional/p2p_permissions.py @@ -43,6 +43,13 @@ class P2PPermissionsTests(BitcoinTestFramework): True) self.checkpermission( + # check without deprecatedrpc=whitelisted + ["-whitelist=127.0.0.1"], + # Make sure the default values in the command line documentation match the ones here + ["relay", "noban", "mempool", "download"], + None) + + self.checkpermission( # no permission (even with forcerelay) ["-whitelist=@127.0.0.1", "-whitelistforcerelay=1"], [], @@ -81,6 +88,12 @@ class P2PPermissionsTests(BitcoinTestFramework): False) self.checkpermission( + # check without deprecatedrpc=whitelisted + ["-whitelist=noban,mempool@127.0.0.1", "-whitelistrelay"], + ["noban", "mempool", "download"], + None) + + self.checkpermission( # legacy whitelistforcerelay should be ignored ["-whitelist=noban,mempool@127.0.0.1", "-whitelistforcerelay"], ["noban", "mempool", "download"], @@ -149,10 +162,15 @@ class P2PPermissionsTests(BitcoinTestFramework): ) def checkpermission(self, args, expectedPermissions, whitelisted): + if whitelisted is not None: + args = [*args, '-deprecatedrpc=whitelisted'] self.restart_node(1, args) connect_nodes(self.nodes[0], 1) peerinfo = self.nodes[1].getpeerinfo()[0] - assert_equal(peerinfo['whitelisted'], whitelisted) + if whitelisted is None: + assert 'whitelisted' not in peerinfo + else: + assert_equal(peerinfo['whitelisted'], whitelisted) assert_equal(len(expectedPermissions), len(peerinfo['permissions'])) for p in expectedPermissions: if not p in peerinfo['permissions']: |