Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions test/functional/rpc_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
# from test_framework.util import assert_raises_rpc_error
from test_framework.util import assert_raises_rpc_error, assert_equal

class DeprecatedRpcTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
self.extra_args = [[], []]
self.extra_args = [[], ["-deprecatedrpc=permissive_bool"]]

def run_test(self):
self.test_permissive_bool()
# This test should be used to verify correct behaviour of deprecated
# RPC methods with and without the -deprecatedrpc flags. For example:
#
Expand All @@ -25,5 +26,17 @@ def run_test(self):
# self.generate(self.nodes[1], 1)
self.log.info("No tested deprecated RPC methods")


def test_permissive_bool(self):
self.generate(self.nodes[0], 1)
assert_equal([], self.nodes[0].protx("list", "valid", True))
assert_raises_rpc_error(-8, 'detailed must be a JSON boolean. Pass -deprecatedrpc=permissive_bool to allow legacy boolean parsing.', self.nodes[0].protx, "list", "valid", 1)
assert_raises_rpc_error(-8, 'detailed must be a JSON boolean. Pass -deprecatedrpc=permissive_bool to allow legacy boolean parsing.', self.nodes[0].protx, "list", "valid", "1")

assert_equal([], self.nodes[1].protx("list", "valid", True))
assert_equal([], self.nodes[1].protx("list", "valid", 1))
assert_equal([], self.nodes[1].protx("list", "valid", "1"))


if __name__ == '__main__':
DeprecatedRpcTest().main()
Loading