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:
| Scenario | Required observation |
|---|---|
| Definite purchase rejection | No ticket, no fee/position income, no money assumed moved. |
| Purchase debit applied then timeout | No automatic debit replay; manual evidence determines admission or exact compensation. |
| Win/refund credit applied then timeout | Result/cancellation remains final, obligation stays unresolved until evidence, no duplicate credit. |
| Same key and same payload | Original effective result returned with no second mutation. |
| Same key and different payload | Conflict, no mutation. |
| Cancel admitted ticket | Full original stake credited with the refund key; no winning obligation. |
| Late admitted attempt after confirmed debit | Gate 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
unknownalways escalates to manual review- operator team can explain exact next step for each failure state
