deposit() derives an idempotent escrow ID and checks both modern and legacy commitments. deposit_partial() creates a commitment directly and writes it without checking existing escrow state or escrow ID mappings, risking accidental overwrites and inconsistent idempotency.
Affected areas: app/contract/contracts/src/escrow.rs, app/contract/contracts/src/escrow_id.rs, app/contract/contracts/src/storage.rs, app/contract/contracts/src/errors.rs, app/contract/contracts/src/test.rs, snapshots/docs.
Implementation scope:
- Derive escrow IDs for partial deposits using token, amount due, initial payment, owner, salt, timeout, and arbiter.
- Reject duplicate commitments and duplicate legacy commitments consistently.
- Store and expose escrow ID to commitment mapping for partial escrows.
- Add regression tests for identical retry, same salt different initial payment, and existing commitment collision.
Acceptance criteria:
deposit_partial cannot overwrite an existing escrow.
- Identical retry returns or reports the existing escrow deterministically.
- Backend/indexer can correlate partial escrow events with stable IDs.
deposit()derives an idempotent escrow ID and checks both modern and legacy commitments.deposit_partial()creates a commitment directly and writes it without checking existing escrow state or escrow ID mappings, risking accidental overwrites and inconsistent idempotency.Affected areas:
app/contract/contracts/src/escrow.rs,app/contract/contracts/src/escrow_id.rs,app/contract/contracts/src/storage.rs,app/contract/contracts/src/errors.rs,app/contract/contracts/src/test.rs, snapshots/docs.Implementation scope:
Acceptance criteria:
deposit_partialcannot overwrite an existing escrow.