| 129 | } |
| 130 | |
| 131 | uint256 ParseHashV(const UniValue& v, string strName) |
| 132 | { |
| 133 | string strHex; |
| 134 | if (v.isStr()) |
| 135 | strHex = v.get_str(); |
| 136 | if (!IsHex(strHex)) // Note: IsHex("") is false |
| 137 | throw JSONRPCError(RPC_INVALID_PARAMETER, strName+" must be hexadecimal string (not '"+strHex+"')"); |
| 138 | uint256 result; |
| 139 | result.SetHex(strHex); |
| 140 | return result; |
| 141 | } |
| 142 | uint256 ParseHashO(const UniValue& o, string strKey) |
| 143 | { |
| 144 | return ParseHashV(find_value(o, strKey), strKey); |
no test coverage detected