mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-23 13:40:52 +00:00
chore: Update libxrpl to 3.2.0 (#3114)
This commit is contained in:
@@ -69,7 +69,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcNOT_SUPPORTED` if the value matched; otherwise no error is returned
|
||||
* @return `RippledError::RpcNotSupported` if the value matched; otherwise no error is returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
verify(boost::json::value const& value, std::string_view key) const
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
auto const res = value_to<T>(value.as_object().at(key));
|
||||
if (value_ == res) {
|
||||
return Error{Status{
|
||||
RippledError::rpcNOT_SUPPORTED,
|
||||
RippledError::RpcNotSupported,
|
||||
fmt::format("Not supported field '{}'s value '{}'", std::string{key}, res)
|
||||
}};
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcNOT_SUPPORTED` if the field is found; otherwise no error is
|
||||
* @return `RippledError::RpcNotSupported` if the field is found; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] static MaybeError
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
{
|
||||
if (value.is_object() and value.as_object().contains(key)) {
|
||||
return Error{Status{
|
||||
RippledError::rpcNOT_SUPPORTED, "Not supported field '" + std::string{key} + '\''
|
||||
RippledError::RpcNotSupported, "Not supported field '" + std::string{key} + '\''
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ struct Type final {
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -146,7 +146,7 @@ struct Type final {
|
||||
auto const convertible = (checkTypeAndClamp<Types>(res) || ...);
|
||||
|
||||
if (not convertible)
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS}};
|
||||
return Error{Status{RippledError::RpcInvalidParams}};
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
// TODO: may want a way to make this code more generic (e.g. use a free
|
||||
// function that can be overridden for this comparison)
|
||||
if (res < min_ || res > max_)
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS}};
|
||||
return Error{Status{RippledError::RpcInvalidParams}};
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
auto const res = value_to<Type>(value.as_object().at(key));
|
||||
|
||||
if (res < min_)
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS}};
|
||||
return Error{Status{RippledError::RpcInvalidParams}};
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
auto const res = value_to<Type>(value.as_object().at(key));
|
||||
|
||||
if (res > max_)
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS}};
|
||||
return Error{Status{RippledError::RpcInvalidParams}};
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -332,7 +332,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
|
||||
auto const res = value_to<Type>(value.as_object().at(key));
|
||||
if (res != original_)
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS}};
|
||||
return Error{Status{RippledError::RpcInvalidParams}};
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
*
|
||||
* @param value The JSON value representing the outer object
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] MaybeError
|
||||
@@ -403,7 +403,7 @@ public:
|
||||
auto const res = value_to<Type>(value.as_object().at(key));
|
||||
if (std::find(std::begin(options_), std::end(options_), res) == std::end(options_)) {
|
||||
return Error{
|
||||
Status{RippledError::rpcINVALID_PARAMS, fmt::format("Invalid field '{}'.", key)}
|
||||
Status{RippledError::RpcInvalidParams, fmt::format("Invalid field '{}'.", key)}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -460,18 +460,18 @@ checkIsU32Numeric(std::string_view sv);
|
||||
|
||||
template <class HexType>
|
||||
requires(
|
||||
std::is_same_v<HexType, ripple::uint160> || std::is_same_v<HexType, ripple::uint192> ||
|
||||
std::is_same_v<HexType, ripple::uint256>
|
||||
std::is_same_v<HexType, xrpl::uint160> || std::is_same_v<HexType, xrpl::uint192> ||
|
||||
std::is_same_v<HexType, xrpl::uint256>
|
||||
)
|
||||
MaybeError
|
||||
makeHexStringValidator(boost::json::value const& value, std::string_view key)
|
||||
{
|
||||
if (!value.is_string())
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS, std::string(key) + "NotString"}};
|
||||
return Error{Status{RippledError::RpcInvalidParams, std::string(key) + "NotString"}};
|
||||
|
||||
HexType parsedInt;
|
||||
if (!parsedInt.parseHex(value.as_string().c_str()))
|
||||
return Error{Status{RippledError::rpcINVALID_PARAMS, std::string(key) + "Malformed"}};
|
||||
return Error{Status{RippledError::RpcInvalidParams, std::string(key) + "Malformed"}};
|
||||
|
||||
return MaybeError{};
|
||||
}
|
||||
@@ -574,7 +574,7 @@ struct CustomValidators final {
|
||||
static CustomValidator subscribeAccountsValidator;
|
||||
|
||||
/**
|
||||
* @brief Validates an asset (ripple::Issue).
|
||||
* @brief Validates an asset (xrpl::Issue).
|
||||
*
|
||||
* Used by amm_info.
|
||||
*/
|
||||
@@ -605,7 +605,7 @@ struct Hex256ItemType final {
|
||||
*
|
||||
* @param value the value to verify
|
||||
* @param key The key used to retrieve the tested value from the outer object
|
||||
* @return `RippledError::rpcINVALID_PARAMS` if validation failed; otherwise no error is
|
||||
* @return `RippledError::RpcInvalidParams` if validation failed; otherwise no error is
|
||||
* returned
|
||||
*/
|
||||
[[nodiscard]] static MaybeError
|
||||
@@ -618,10 +618,10 @@ struct Hex256ItemType final {
|
||||
|
||||
// loop through each item in the array and make sure it is uint256 hex string
|
||||
for (auto const& elem : res.as_array()) {
|
||||
ripple::uint256 num;
|
||||
xrpl::uint256 num;
|
||||
if (!elem.is_string() || !num.parseHex(elem.as_string())) {
|
||||
return Error{
|
||||
Status{RippledError::rpcINVALID_PARAMS, "Item is not a valid uint256 type."}
|
||||
Status{RippledError::RpcInvalidParams, "Item is not a valid uint256 type."}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user