mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-22 05:00:52 +00:00
style: Set clang-format width 100 (#2953)
This commit is contained in:
@@ -82,20 +82,25 @@ parseAuthorizeCredentials(boost::json::array const& jv)
|
||||
jo.at(JS(issuer)).is_string(),
|
||||
"issuer must be string, should already be checked in AuthorizeCredentialValidator"
|
||||
);
|
||||
auto const issuer =
|
||||
ripple::parseBase58<ripple::AccountID>(static_cast<std::string>(jo.at(JS(issuer)).as_string()));
|
||||
auto const issuer = ripple::parseBase58<ripple::AccountID>(
|
||||
static_cast<std::string>(jo.at(JS(issuer)).as_string())
|
||||
);
|
||||
ASSERT(
|
||||
issuer.has_value(), "issuer must be present, should already be checked in AuthorizeCredentialValidator."
|
||||
issuer.has_value(),
|
||||
"issuer must be present, should already be checked in AuthorizeCredentialValidator."
|
||||
);
|
||||
|
||||
ASSERT(
|
||||
jo.at(JS(credential_type)).is_string(),
|
||||
"credential_type must be string, should already be checked in AuthorizeCredentialValidator"
|
||||
"credential_type must be string, should already be checked in "
|
||||
"AuthorizeCredentialValidator"
|
||||
);
|
||||
auto const credentialType = ripple::strUnHex(static_cast<std::string>(jo.at(JS(credential_type)).as_string()));
|
||||
auto const credentialType =
|
||||
ripple::strUnHex(static_cast<std::string>(jo.at(JS(credential_type)).as_string()));
|
||||
ASSERT(
|
||||
credentialType.has_value(),
|
||||
"credential_type must be present, should already be checked in AuthorizeCredentialValidator."
|
||||
"credential_type must be present, should already be checked in "
|
||||
"AuthorizeCredentialValidator."
|
||||
);
|
||||
|
||||
auto credential = ripple::STObject::makeInnerObject(ripple::sfCredential);
|
||||
@@ -119,7 +124,9 @@ fetchCredentialArray(
|
||||
ripple::STArray authCreds;
|
||||
std::unordered_set<std::string_view> elems;
|
||||
for (auto const& elem : credID.value()) {
|
||||
ASSERT(elem.is_string(), "should already be checked in validators.hpp that elem is a string.");
|
||||
ASSERT(
|
||||
elem.is_string(), "should already be checked in validators.hpp that elem is a string."
|
||||
);
|
||||
|
||||
if (elems.contains(elem.as_string()))
|
||||
return Error{Status{RippledError::rpcBAD_CREDENTIALS, "duplicates in credentials."}};
|
||||
@@ -147,11 +154,15 @@ fetchCredentialArray(
|
||||
return Error{Status{RippledError::rpcBAD_CREDENTIALS, "credentials are expired"}};
|
||||
|
||||
if (sleCred.getAccountID(ripple::sfSubject) != srcAcc)
|
||||
return Error{Status{RippledError::rpcBAD_CREDENTIALS, "credentials don't belong to the root account"}};
|
||||
return Error{Status{
|
||||
RippledError::rpcBAD_CREDENTIALS, "credentials don't belong to the root account"
|
||||
}};
|
||||
|
||||
auto credential = ripple::STObject::makeInnerObject(ripple::sfCredential);
|
||||
credential.setAccountID(ripple::sfIssuer, sleCred.getAccountID(ripple::sfIssuer));
|
||||
credential.setFieldVL(ripple::sfCredentialType, sleCred.getFieldVL(ripple::sfCredentialType));
|
||||
credential.setFieldVL(
|
||||
ripple::sfCredentialType, sleCred.getFieldVL(ripple::sfCredentialType)
|
||||
);
|
||||
authCreds.push_back(std::move(credential));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user