Skip to content

[ANCHOR-1296]: SEP-6 wallet PATCH, quote funding-method conflict & claimable-balance non-support - #2033

Merged
ceciliaromao merged 16 commits into
developfrom
feat/anchor-1296-sep6-patch-quote-claimable
Sep 30, 2026
Merged

ceciliaromao merged 16 commits into
developfrom
feat/anchor-1296-sep6-patch-quote-claimable

Conversation

@ceciliaromao

Copy link
Copy Markdown
Collaborator

Description

  • Adds PATCH /sep6/transactions/{id}, the wallet-facing endpoint SEP-6 defines for answering a pending_transaction_info_update request. Without it, a SEP-6 transaction the business server puts into that status has no way out — the wallet had nothing to PATCH against.
  • Adds a guard in the Platform API: a PATCH /transactions call can no longer move a SEP-6 transaction into pending_transaction_info_update with an empty required_info_updates, which would have stranded it the same way (mirrors the existing SEP-31 guard).
  • Adds a check that deposit-exchange/withdraw-exchange's funding_method matches the SEP-38 quote's delivery method, and rejects the request with a 400 when it doesn't.
  • Adds end-to-end coverage for quote-rejection paths (Quote not found, asset/amount mismatch) that already worked but had no HTTP-level test, and for claimable-balance non-support (a wallet declaring claimable_balances_supported=true against an anchor that doesn't support it still gets a normal deposit).

Context

  • Closes the last three gaps this branch owned per the SEP-6 coverage audit (test/anchor-1296-sep6-coverage, [ANCHOR-1296]: Close remaining SEP-6 coverage audit gaps #2031): the wallet PATCH, the quote funding-method conflict, and the claimable-balance non-support check.
  • Feature spec, design and task breakdown: .specs/features/sep6-patch-quote-claimable/ (30 acceptance criteria, S6PQ-01..30).

Testing

  • ./gradlew test
  • ./gradlew spotlessCheck :core:test :platform:test
  • ./gradlew :essential-tests:test --tests "*Sep6Tests*" — run twice in a row (67/67 passing)
  • ./gradlew :essential-tests:test --tests "*Sep6PlatformApiTests*" --tests "*Sep38Tests*" — passing, except one pre-existing, order-dependent flake unrelated to this diff (see Known limitations)
  • Independent Verifier pass (spec-anchored outcome check across all 30 acceptance criteria + a discrimination-sensor mutation test, 3/3 mutations killed) and a 6-dimension pre-push review (security / quality / architecture / performance / requirements / regression) — no findings

Documentation

  • New Platform API field PlatformTransactionData.fields: the values a SEP-6 wallet supplied through PATCH /transactions/:id. Read-only — the deprecated PATCH /transactions never reads it back.
  • SEP-6 transactions now also expose required_info_message/required_info_updates through the Platform API (previously mapped for SEP-31 only).
  • Behavior change: the Platform API now rejects a PATCH /transactions that would put a SEP-6 transaction into pending_transaction_info_update with nothing requested.
  • Behavior change: deposit-exchange/withdraw-exchange now reject a funding_method that conflicts with the referenced quote's delivery method.
  • New Flyway migration V36__sep6_add_fields.sql.

Known limitations

  • Two concurrent PATCHes on the same SEP-6 transaction can surface as an unhandled 500 (an OptimisticLockingFailureException from the @Version lock) instead of a mapped 400, the same exposure SEP-31's wallet PATCH already has. Not covered here — tracked as a follow-up decision, not part of this fix.
  • Observed one intermittent, pre-existing failure in Sep6PlatformApiTests unrelated to this diff: shared KYC state on a hardcoded test account, reused across all PlatformApiTests subclasses on a long-lived local stack. Root-caused via a JSONCompareMode.LENIENT assertion this diff's field additions can't affect; expected to be clean on CI's fresh containers.

@ceciliaromao
ceciliaromao merged commit 558bb02 into develop Sep 30, 2026
11 checks passed
@ceciliaromao
ceciliaromao deleted the feat/anchor-1296-sep6-patch-quote-claimable branch September 30, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants