MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ParseHashV

Function ParseHashV

src/rpc/core/rpcserver.cpp:123–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123uint256 ParseHashV(const Value& v, string strName) {
124 string strHex;
125 if (v.type() == str_type)
126 strHex = v.get_str();
127 if (!IsHex(strHex)) // Note: IsHex("") is false
128 throw JSONRPCError(RPC_INVALID_PARAMETER, strName + " must be hexadecimal string (not '" + strHex + "')");
129
130 uint256 result;
131 result.SetHex(strHex);
132
133 return result;
134}
135uint256 ParseHashO(const Object& o, string strKey) {
136 return ParseHashV(find_value(o, strKey), strKey);
137}

Callers 1

ParseHashOFunction · 0.85

Calls 4

IsHexFunction · 0.85
JSONRPCErrorFunction · 0.85
typeMethod · 0.80
SetHexMethod · 0.45

Tested by

no test coverage detected