MCPcopy Create free account
hub / github.com/ElementsProject/elements / RPCTypeCheckArgument

Function RPCTypeCheckArgument

src/rpc/util.cpp:56–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void RPCTypeCheckArgument(const UniValue& value, const UniValueType& typeExpected)
57{
58 if (!typeExpected.typeAny && value.type() != typeExpected.type) {
59 throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Expected type %s, got %s", uvTypeName(typeExpected.type), uvTypeName(value.type())));
60 }
61}
62
63void RPCTypeCheckObj(const UniValue& o,
64 const std::map<std::string, UniValueType>& typesExpected,

Callers 7

lockunspentFunction · 0.85
listunspentFunction · 0.85
FundTransactionFunction · 0.85
walletcreatefundedpsbtFunction · 0.85
estimatesmartfeeFunction · 0.85
estimaterawfeeFunction · 0.85
RPCTypeCheckFunction · 0.85

Calls 3

JSONRPCErrorFunction · 0.85
uvTypeNameFunction · 0.85
typeMethod · 0.80

Tested by

no test coverage detected