Skip to content

fix(models): ledger_entry DepositPreauth duplicate-credential error uses InvalidValue instead of ValueEqualsValue #334

Description

@e-desouza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions