mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-21 20:50:53 +00:00
fix: Better validator for issuer (#3184)
This commit is contained in:
@@ -363,7 +363,7 @@ CustomValidator CustomValidators::authorizeCredentialValidator =
|
||||
}
|
||||
|
||||
// don't want to change issuer error message to be about credentials
|
||||
if (!issuerValidator.verify(credObj, "issuer")) {
|
||||
if (!accountBase58Validator.verify(credObj, "issuer")) {
|
||||
return Error{
|
||||
Status{ClioError::RpcMalformedAuthorizedCredentials, "issuer NotString"}
|
||||
};
|
||||
|
||||
@@ -347,6 +347,27 @@ generateTestValuesForParametersTest()
|
||||
.expectedErrorMessage = "issuer NotString"
|
||||
},
|
||||
|
||||
ParamTestCaseBundle{
|
||||
.testName = "DepositPreauthAuthorizeCredentialsHexIssuer",
|
||||
.testJson = fmt::format(
|
||||
R"JSON({{
|
||||
"deposit_preauth": {{
|
||||
"owner": "{}",
|
||||
"authorized_credentials": [
|
||||
{{
|
||||
"issuer": "0000000000000000000000000000000000000002",
|
||||
"credential_type": "{}"
|
||||
}}
|
||||
]
|
||||
}}
|
||||
}})JSON",
|
||||
kAccount,
|
||||
kCredentialType
|
||||
),
|
||||
.expectedError = "malformedAuthorizedCredentials",
|
||||
.expectedErrorMessage = "issuer NotString"
|
||||
},
|
||||
|
||||
ParamTestCaseBundle{
|
||||
.testName = "DepositPreauthAuthorizeCredentialsIncorrectCredentialType",
|
||||
.testJson = fmt::format(
|
||||
|
||||
Reference in New Issue
Block a user