mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
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:
@@ -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));
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user