rpc: Fix type in ApplyTypeStrOverride

This should be an integer, not a numeric, as already enforced by the RPC
code and described in the mapping just above the changed line.
This commit is contained in:
Shuvam Pandey
2026-08-14 16:25:40 +02:00
committed by sedited
parent c94074fa1b
commit e07d826e0e
2 changed files with 2 additions and 2 deletions

View File

@@ -311,7 +311,7 @@ void ApplyTypeStrOverride(UniValue& schema, const RPCArg& arg)
};
if (number_or_string.contains(type_label)) {
UniValue one_of{UniValue::VARR};
one_of.push_back(MakeObject({{"type", "number"}}));
one_of.push_back(MakeObject({{"type", "integer"}}));
one_of.push_back(MakeObject({{"type", "string"}}));
schema = UniValue{UniValue::VOBJ};
schema.pushKV("oneOf", std::move(one_of));

View File

@@ -52,7 +52,7 @@ class OpenRPCDocTest(BitcoinTestFramework):
self.log.info("Checking type_str override schemas")
getblockstats = find_method(openrpc, "getblockstats")
hash_or_height = find_param(getblockstats, "hash_or_height")
assert_equal(hash_or_height["schema"], {"oneOf": [{"type": "number"}, {"type": "string"}]})
assert_equal(hash_or_height["schema"], {"oneOf": [{"type": "integer"}, {"type": "string"}]})
self.log.info("Checking fixed-length array schemas")
deriveaddresses = find_method(openrpc, "deriveaddresses")