| 897 | } |
| 898 | |
| 899 | UniValue 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 | |
| 912 | std::string RPCArg::GetFirstName() const |
| 913 | { |
no test coverage detected