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

Function ParseHashV

src/rpc/util.cpp:105–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105uint256 ParseHashV(const UniValue& v, std::string strName)
106{
107 std::string strHex(v.get_str());
108 if (64 != strHex.length())
109 throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be of length %d (not %d, for '%s')", strName, 64, strHex.length(), strHex));
110 if (!IsHex(strHex)) // Note: IsHex("") is false
111 throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')");
112 return uint256S(strHex);
113}
114uint256 ParseHashO(const UniValue& o, std::string strKey)
115{
116 return ParseHashV(find_value(o, strKey), strKey);

Callers 15

removeprunedfundsFunction · 0.85
bumpfee_helperFunction · 0.85
issueassetFunction · 0.85
listsinceblockFunction · 0.85
transactions.cppFile · 0.85
FUZZ_TARGET_INITFunction · 0.85
prioritisetransactionFunction · 0.85
getblocktemplateFunction · 0.85
getrawtransactionFunction · 0.85
gettxoutproofFunction · 0.85
rawissueassetFunction · 0.85
rawreissueassetFunction · 0.85

Calls 3

JSONRPCErrorFunction · 0.85
IsHexFunction · 0.85
uint256SFunction · 0.85

Tested by 1

FUZZ_TARGET_INITFunction · 0.68