MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MatchesType

Method MatchesType

src/rpc/util.cpp:899–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

897}
898
899UniValue RPCArg::MatchesType(const UniValue& request) const
900{
901 if (m_opts.skip_type_check) return true;
902 if (IsOptional() && request.isNull()) return true;
903 const auto exp_type{ExpectedType(m_type)};
904 if (!exp_type) return true; // nothing to check
905
906 if (*exp_type != request.getType()) {
907 return strprintf("JSON value of type %s is not of expected type %s", uvTypeName(request.getType()), uvTypeName(*exp_type));
908 }
909 return true;
910}
911
912std::string RPCArg::GetFirstName() const
913{

Callers 1

HandleRequestMethod · 0.80

Calls 14

ExpectedTypeFunction · 0.85
uvTypeNameFunction · 0.85
isNullMethod · 0.80
getTypeMethod · 0.80
isTrueMethod · 0.80
pushKVMethod · 0.80
getObjMapMethod · 0.80
findMethod · 0.80
sizeMethod · 0.45
atMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected