OpenPoly logo
Testing And Staging

Wallet failure drills

Required wallet mutation failure drills before production.

Wallet failure drills

Before production, prove operator flow handles non-happy wallet outcomes safely.

Debit failure drill

Expected result:

  • debit operation -> failed
  • order -> failed
  • no AMM trade created
  • webhook failure event emitted

Observed staging mode name in simulator runbook:

  • fail_debit

Debit unknown drill

Expected result:

  • debit operation -> unknown
  • order -> manual_review
  • no AMM trade executed until resolution
  • failure or manual-review webhook evidence present

Observed staging mode name:

  • unknown_debit

Credit failure drill

Expected result:

  • payout-side balance operation -> failed
  • redemption or sell item -> manual_review
  • operator must inspect before any replay or retry decision

Observed staging mode name:

  • fail_credit

Credit unknown drill

Expected result:

  • payout-side balance operation -> unknown
  • redemption or sell item -> manual_review
  • operator wallet evidence and human review required

Observed staging mode name:

  • unknown_credit

Polyflight drills

Run the same transport failures against each Polyflight effect, using its stable key:

ScenarioRequired observation
Definite purchase rejectionNo ticket, no fee/position income, no money assumed moved.
Purchase debit applied then timeoutNo automatic debit replay; manual evidence determines admission or exact compensation.
Win/refund credit applied then timeoutResult/cancellation remains final, obligation stays unresolved until evidence, no duplicate credit.
Same key and same payloadOriginal effective result returned with no second mutation.
Same key and different payloadConflict, no mutation.
Cancel admitted ticketFull original stake credited with the refund key; no winning obligation.
Late admitted attempt after confirmed debitGate rejects the ticket and exact debit reversal is scheduled.

Test both OpenPoly's user-scoped simulator and a separate real REST v1 test adapter. Simulator results are not external-wallet certification.

What to capture for each drill

  • idempotency_key
  • Opinion order/redemption ID or Polyflight purchase/ticket/flight IDs
  • balance operation ID and payment-obligation status when applicable
  • final status
  • failure reason
  • webhook event ID if emitted
  • statement/liability/export result when the scenario creates or clears a Polyflight obligation

Pass criteria

  • no duplicate debit or credit side effect
  • unknown always escalates to manual review
  • operator team can explain exact next step for each failure state
Copyright © 2026