From 5603ae0ffa3f0be3d22e8a09008e46c5d48ae12f Mon Sep 17 00:00:00 2001 From: Pol Espinasa Date: Thu, 2 Apr 2026 21:03:04 +0200 Subject: [PATCH] test: fix send_batch_request to pass callables when using --usecli send_batch_request() was building raw dicts without a "jsonrpc" version, which made Core to treat them as version 1.0 requests. This worked in normal mode, but failed with --usecli because TestNodeCLI.batch() expects callables, not dicts. This commit fixes it by using get_request() which is defined in both AuthServiceProxy and TestNodeCLIAttr. The assert is changed because by using get_reques() AuthServiceProxy treats it as "jsonrpc" version 2.0 requests, which don't return "error" keys. --- test/functional/feature_index_prune.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/feature_index_prune.py b/test/functional/feature_index_prune.py index 49520be0586..0654e04f586 100755 --- a/test/functional/feature_index_prune.py +++ b/test/functional/feature_index_prune.py @@ -18,11 +18,11 @@ from typing import List, Any def send_batch_request(node: TestNode, method: str, params: List[Any]) -> List[Any]: """Send batch request and parse all results""" - data = [{"method": method, "params": p} for p in params] + data = [getattr(node, method).get_request(*p) for p in params] response = node.batch(data) result = [] for item in response: - assert item["error"] is None, item["error"] + assert "error" not in item, item["error"] result.append(item["result"]) return result