Problem
src/models/requests/ledger_entry.rs — the DepositPreauth request selector raises XRPLModelException::InvalidValue for duplicate credential entries in authorized_credentials, while every other site that detects duplicate credentials (validate_credential_ids, DepositPreauth transaction model, DepositPreauth ledger object model) raises XRPLModelException::ValueEqualsValue.
This inconsistency breaks callers that normalise validation errors by matching on ValueEqualsValue to detect duplicates: the LedgerEntry { deposit_preauth: Some(...) } path silently falls through to the default arm.
Affected sites
| File |
Error raised for duplicate credentials |
src/models/transactions/mod.rs (validate_credential_ids) |
ValueEqualsValue |
src/models/transactions/deposit_preauth.rs |
ValueEqualsValue |
src/models/ledger/objects/deposit_preauth.rs |
ValueEqualsValue |
src/models/requests/ledger_entry.rs |
❌ InvalidValue (wrong) |
Fix
Change ledger_entry.rs DepositPreauth.get_errors() to raise ValueEqualsValue when a duplicate credential is detected, matching all other validation sites.
Notes
Found during code review of PR #154 (XLS-70 Credentials support). Not introduced by that PR — pre-existing inconsistency.
Problem
src/models/requests/ledger_entry.rs— theDepositPreauthrequest selector raisesXRPLModelException::InvalidValuefor duplicate credential entries inauthorized_credentials, while every other site that detects duplicate credentials (validate_credential_ids,DepositPreauthtransaction model,DepositPreauthledger object model) raisesXRPLModelException::ValueEqualsValue.This inconsistency breaks callers that normalise validation errors by matching on
ValueEqualsValueto detect duplicates: theLedgerEntry { deposit_preauth: Some(...) }path silently falls through to the default arm.Affected sites
src/models/transactions/mod.rs(validate_credential_ids)ValueEqualsValuesrc/models/transactions/deposit_preauth.rsValueEqualsValuesrc/models/ledger/objects/deposit_preauth.rsValueEqualsValuesrc/models/requests/ledger_entry.rsInvalidValue(wrong)Fix
Change
ledger_entry.rsDepositPreauth.get_errors()to raiseValueEqualsValuewhen a duplicate credential is detected, matching all other validation sites.Notes
Found during code review of PR #154 (XLS-70 Credentials support). Not introduced by that PR — pre-existing inconsistency.