Claim all parked follow-up: Playwright expiry-park E2E + confirm-dialog gas estimate (#253) #259

Closed
opened 2026-05-31 13:52:00 +00:00 by PlasticDigits · 13 comments
PlasticDigits commented 2026-05-31 13:52:00 +00:00 (Migrated from gitlab.com)

Summary

Follow-up to GitLab #253 (Claim all parked UI, merged). Two related gaps remain:

  1. Playwright claim-all E2E — no funded browser test walks the full place → expire-park → indexer parked_expired → Claim all parked → claim_expired_limit_orders path.
  2. Confirm-dialog gas estimate — Claim all parked uses window.confirm with count-only copy; batch cancel/ladder flows already surface estimated LUNC gas elsewhere.

Bundle both under one issue because they harden the same user action (batch parked refund confirm + on-chain verification).


Current codebase

Claim all parked UI (#253 — shipped)

Limit order Playwright E2E (no expiry-park harness)

On-chain / contract reference for harness design

  • Expiry park during hybrid book walk: place limit with expires_at, advance block time, taker hybrid swap → wasm limit_order_expired_parked (no CW20 to maker in taker tx — #120).
  • Park cap: ≤ 5 parks per swap walk (#250).
  • Contract tests: smartcontracts/tests/src/limit_order_tests.rs (e.g. expired bid walk + park event); batch claim: batch_claim_expired_two_orders_one_tx.
  • Indexer lifecycle: active → parked_expired → refunded (#142).

Gas display precedent (not wired to claim-all confirm)


Why this is needed

Gap Impact
No claim-all E2E Regressions in batch execute path, indexer polling, chunk confirms, or test ids won't be caught in CI e2e-tx. Manual QA only today.
No gas in confirm Makers approving Claim all parked cannot compare 1 batch tx vs N× single claim gas before signing; undermines #246 batch gas savings story and increases surprise insufficient-fee failures.

Constraints / guardrails

Playwright / harness

  • Reuse strict E2E stack — e2e-tx project, serial mode, requireLimitTxPair, skipOrFailIfPairPaused, dev-wallet provisioning (scripts/e2e-provision-dev-wallet.sh). Do not weaken #201 strict-chain defaults.
  • Indexer required — parked rows come from indexer lifecycle_status; E2E global setup must have indexer + CORS aligned (see docs/frontend.md § Local dev indexer CORS).
  • Time / expiry — harness must deterministically produce ≥ 2 parked_expired rows for dev wallet (place with short expires_at, advance chain time or wait, trigger hybrid swap as taker — mirror contract test pattern). Respect 5 parks/swap cap when placing many expired orders.
  • Single worker — claim-all tx test runs in --project=e2e-tx (shared dev account).
  • Confirm handling — Playwright must accept window.confirm (or stub) for claim-all and optional chunked confirms.
  • LCD assertions — poll tx for claim_expired_limit_orders / claim_expired_limit_orders_batch wasm action(s), same pattern as existing limit tx tests.

Gas estimate in confirm

  • Same fee math as broadcast — use gasLimitForLimitOrderCancelBatch(chunkSize) + estimateFeeUlunaAmountForGasLimit + formatTokenAmount (6 decimals LUNC); no ad-hoc constants in UI.
  • Chunk-aware — when N > 30, show per-chunk estimate in confirm copy (and cumulative note if multiple chunks).
  • Optional savings line — compare batch vs N × CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT (mirror ladder formatLimitBatchGasSavingsLine pattern); keep copy concise inside window.confirm or migrate to a small modal if confirm string exceeds reasonable length.
  • Do not block on live LCD fee query — estimate from static gas model only (consistent with pre-submit hints elsewhere).
  • Pause / disconnect — unchanged; no gas copy when action disabled.

Relevant files

Area Files
Claim-all UI LimitOrderMyPlacementsPanel.tsx, limitExpiredClaimBatch.ts, useLimitExpiredClaimMutation.ts
Gas terraGas.ts, transactions.ts (CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT), limitOrderBatchGasSummary.ts, formatAmount.ts
New / extended E2E e2e/limit-orders-tx.spec.ts or e2e/limit-orders-claim-all-tx.spec.ts, e2e/helpers/limit-e2e.ts (+ new limit-expiry-park-e2e.ts helper recommended)
Indexer poll e2e/helpers/lcd.ts, optional indexer client poll for parked_expired
Docs / skills skills/AGENTS_E2E_LIMIT_ORDERS_TX.md, skills/AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md, docs/testing.md, frontend-dapp/e2e/README.md
Contract reference smartcontracts/tests/src/limit_order_tests.rs

A. Expiry-park E2E harness + claim-all test

  1. Helper module (e.g. e2e/helpers/limit-expiry-park-e2e.ts):
    • Place 2+ limits with near-term expires_at (via UI advanced expiry or terrad script if UI path too slow).
    • Advance LocalTerra time / wait until expired (document approach in e2e/README.md).
    • Execute hybrid swap as taker (second wallet or scripted terrd) to emit limit_order_expired_parked.
    • Poll indexer GET .../limit-placements until ≥ 2 parked_expired rows for dev wallet (timeout aligned with existing LCD polls).
  2. Playwright test in e2e-tx:
    • Navigate /limits, assert limits-page-claim-all-parked visible with (N ≥ 2).
    • Click → confirm → expect success alert + tx hash.
    • LCD poll: claim_expired_limit_orders batch action present.
    • Optional: assert parked rows cleared after indexer refresh.
  3. Update AGENTS_E2E_LIMIT_ORDERS_TX.md + AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md with runbook and cross-link.

B. Gas estimate in confirm dialog

  1. Extend confirmExpiredClaimBatchMessage (or sibling formatter) to append est. ~X LUNC gas using gasLimitForLimitOrderCancelBatch(chunk.length).
  2. When N ≥ 2, optionally append savings vs N singles (reuse / extend formatLimitBatchGasSavingsLine semantics for claim path).
  3. Update Vitest for new confirm strings; keep messages readable (< ~500 chars) or introduce a lightweight confirm modal component if needed.
  4. Document invariant in docs/limit-orders.md § #253 follow-up and agent skill.

Acceptance criteria

  • E2E harness reproducibly creates ≥ 2 indexer parked_expired rows for dev wallet on an unpaused pair.
  • Playwright e2e-tx test: Claim all parked → one batch tx → LCD shows batch claim wasm action.
  • Confirm dialog includes estimated LUNC fee for the batch (per chunk when chunked).
  • Gas copy uses gasLimitForLimitOrderCancelBatch / estimateFeeUlunaAmountForGasLimit only.
  • Vitest updated for confirm copy; existing claim-all panel tests still pass.
  • Skills + e2e/README.md document harness prerequisites and run command.

Test plan — functional paths

  • Harness: 2 expired limits → hybrid swap → indexer shows parked_expired × 2.
  • E2E: claim-all button enabled → confirm → success alert → tx hash link valid.
  • E2E: LCD tx contains claim_expired_limit_orders (batch attrs).
  • Vitest: confirm message includes formatted LUNC estimate for N=2, N=5, chunked N=31 (2 chunks).
  • Manual: compare displayed estimate vs actual gas_used on LocalTerra (within buffer tolerance).
  • /trade compact panel: smoke that gas copy path shared with /limits (if confirm helper is shared).

Test plan — attack / abuse vectors

  • False fee display: estimate must not understate Fee.amount sent at broadcast (same effectiveGasPriceUluna floor as #127).
  • E2E harness: cannot claim without parked rows (no premature claim-all click success).
  • Paused pair: E2E skips/fails if pair paused before claim (L6) — no gas burned on doomed tx.
  • Stale indexer: if harness claims before indexer marks parked_expired, test fails loudly (no flaky pass).
  • Chunk loop: E2E or Vitest documents that each chunk requires separate confirm (no unbounded auto-chaining without user accept).

Verification criteria

  • npm test — Vitest for limitExpiredClaimBatch, LimitOrderMyPlacementsPanel (updated confirm copy).
  • bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test <new-spec> --project=e2e-tx passes with LocalTerra + indexer + deploy + dev-wallet provision.
  • CI e2e-tx job green (or documented new job step if spec split).
  • Manual: 3 parked rows → confirm shows batch gas < 3× single-claim estimate.
  • Docs/skills cross-link #253, #246, and this issue.

## Summary Follow-up to [GitLab #253](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/253) (**Claim all parked** UI, merged). Two related gaps remain: 1. **Playwright claim-all E2E** — no funded browser test walks the full **place → expire-park → indexer `parked_expired` → Claim all parked → `claim_expired_limit_orders`** path. 2. **Confirm-dialog gas estimate** — **Claim all parked** uses `window.confirm` with count-only copy; batch cancel/ladder flows already surface estimated LUNC gas elsewhere. Bundle both under one issue because they harden the same user action (batch parked refund confirm + on-chain verification). --- ## Current codebase ### Claim all parked UI (#253 — shipped) - **Panel:** [`frontend-dapp/src/components/trade/LimitOrderMyPlacementsPanel.tsx`](frontend-dapp/src/components/trade/LimitOrderMyPlacementsPanel.tsx) — **Claim all parked (N)** when **N ≥ 2** `parked_expired` rows; chunks at **30** ids; `window.confirm` via [`confirmExpiredClaimBatchMessage`](frontend-dapp/src/utils/limitExpiredClaimBatch.ts). - **Hook:** [`useLimitExpiredClaimMutation`](frontend-dapp/src/hooks/useLimitExpiredClaimMutation.ts) → `claimExpiredLimitOrder` / `claimExpiredLimitOrders` in [`pair.ts`](frontend-dapp/src/services/terraclassic/pair.ts). - **Gas model:** `gasLimitForLimitOrderCancelBatch(n)` + `estimateFeeUlunaAmountForGasLimit` in [`terraGas.ts`](frontend-dapp/src/services/terraclassic/terraGas.ts) (400k + 80k×N; same as batch cancel — #246). - **Vitest:** hook, batch helpers, panel RTL tests pass; **no Playwright** coverage for claim-all. ### Limit order Playwright E2E (no expiry-park harness) - **Tx spec:** [`frontend-dapp/e2e/limit-orders-tx.spec.ts`](frontend-dapp/e2e/limit-orders-tx.spec.ts) — place, cancel, 5-rung ladder; asserts `place_limit_order`, `cancel_limit_order`, `place_limit_order_batch`. - **Helpers:** [`frontend-dapp/e2e/helpers/limit-e2e.ts`](frontend-dapp/e2e/helpers/limit-e2e.ts), [`lcd.ts`](frontend-dapp/e2e/helpers/lcd.ts) — pair pick, pause guard, submit helpers. - **Skill:** [`skills/AGENTS_E2E_LIMIT_ORDERS_TX.md`](skills/AGENTS_E2E_LIMIT_ORDERS_TX.md) — strict chain, `e2e-tx` project (**1 worker**), dev-wallet provisioning. - **No e2e code** references `parked_expired`, `limit_order_expired_parked`, or `claim_expired_limit_orders`. ### On-chain / contract reference for harness design - Expiry park during hybrid book walk: place limit with `expires_at`, advance block time, taker hybrid swap → wasm **`limit_order_expired_parked`** (no CW20 to maker in taker tx — #120). - Park cap: **≤ 5** parks per swap walk ([#250](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/250)). - Contract tests: [`smartcontracts/tests/src/limit_order_tests.rs`](smartcontracts/tests/src/limit_order_tests.rs) (e.g. expired bid walk + park event); batch claim: `batch_claim_expired_two_orders_one_tx`. - Indexer lifecycle: `active` → `parked_expired` → `refunded` ([#142](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/142)). ### Gas display precedent (not wired to claim-all confirm) - Ladder panel: [`formatLimitBatchGasSavingsLine`](frontend-dapp/src/utils/limitOrderBatchGasSummary.ts) + `ladder-gas-summary` test id in [`limit-orders-tx.spec.ts`](frontend-dapp/e2e/limit-orders-tx.spec.ts). - Fee hints: [`TerraClassicTxFeeHint`](frontend-dapp/src/components/common/TerraClassicTxFeeHint.tsx), [`terraClassicFeeEstimate.ts`](frontend-dapp/src/services/terraclassic/terraClassicFeeEstimate.ts). - **Cancel all mine** ([`OrderBookPanel.tsx`](frontend-dapp/src/components/trade/OrderBookPanel.tsx)): confirm is count-only today — claim-all should at least match or exceed that bar with batch fee copy. --- ## Why this is needed | Gap | Impact | |-----|--------| | **No claim-all E2E** | Regressions in batch execute path, indexer polling, chunk confirms, or test ids won't be caught in CI `e2e-tx`. Manual QA only today. | | **No gas in confirm** | Makers approving **Claim all parked** cannot compare **1 batch tx** vs **N× single claim** gas before signing; undermines #246 batch gas savings story and increases surprise insufficient-fee failures. | --- ## Constraints / guardrails ### Playwright / harness - **Reuse strict E2E stack** — `e2e-tx` project, serial mode, `requireLimitTxPair`, `skipOrFailIfPairPaused`, dev-wallet provisioning (`scripts/e2e-provision-dev-wallet.sh`). Do **not** weaken [#201](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/201) strict-chain defaults. - **Indexer required** — parked rows come from indexer `lifecycle_status`; E2E global setup must have indexer + CORS aligned (see [`docs/frontend.md` § Local dev indexer CORS](docs/frontend.md)). - **Time / expiry** — harness must deterministically produce **≥ 2** `parked_expired` rows for dev wallet (place with short `expires_at`, advance chain time or wait, trigger hybrid swap as taker — mirror contract test pattern). Respect **5 parks/swap** cap when placing many expired orders. - **Single worker** — claim-all tx test runs in `--project=e2e-tx` (shared dev account). - **Confirm handling** — Playwright must accept `window.confirm` (or stub) for claim-all and optional chunked confirms. - **LCD assertions** — poll tx for `claim_expired_limit_orders` / `claim_expired_limit_orders_batch` wasm action(s), same pattern as existing limit tx tests. ### Gas estimate in confirm - **Same fee math as broadcast** — use `gasLimitForLimitOrderCancelBatch(chunkSize)` + `estimateFeeUlunaAmountForGasLimit` + `formatTokenAmount` (6 decimals LUNC); no ad-hoc constants in UI. - **Chunk-aware** — when **N > 30**, show per-chunk estimate in confirm copy (and cumulative note if multiple chunks). - **Optional savings line** — compare batch vs `N × CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT` (mirror ladder `formatLimitBatchGasSavingsLine` pattern); keep copy concise inside `window.confirm` or migrate to a small modal if confirm string exceeds reasonable length. - **Do not block** on live LCD fee query — estimate from static gas model only (consistent with pre-submit hints elsewhere). - **Pause / disconnect** — unchanged; no gas copy when action disabled. --- ## Relevant files | Area | Files | |------|-------| | Claim-all UI | `LimitOrderMyPlacementsPanel.tsx`, `limitExpiredClaimBatch.ts`, `useLimitExpiredClaimMutation.ts` | | Gas | `terraGas.ts`, `transactions.ts` (`CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT`), `limitOrderBatchGasSummary.ts`, `formatAmount.ts` | | New / extended E2E | `e2e/limit-orders-tx.spec.ts` or `e2e/limit-orders-claim-all-tx.spec.ts`, `e2e/helpers/limit-e2e.ts` (+ new `limit-expiry-park-e2e.ts` helper recommended) | | Indexer poll | `e2e/helpers/lcd.ts`, optional indexer client poll for `parked_expired` | | Docs / skills | `skills/AGENTS_E2E_LIMIT_ORDERS_TX.md`, `skills/AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md`, `docs/testing.md`, `frontend-dapp/e2e/README.md` | | Contract reference | `smartcontracts/tests/src/limit_order_tests.rs` | --- ## Recommended solution direction ### A. Expiry-park E2E harness + claim-all test 1. **Helper module** (e.g. `e2e/helpers/limit-expiry-park-e2e.ts`): - Place **2+** limits with near-term `expires_at` (via UI advanced expiry or terrad script if UI path too slow). - Advance LocalTerra time / wait until expired (document approach in `e2e/README.md`). - Execute hybrid swap as taker (second wallet or scripted terrd) to emit `limit_order_expired_parked`. - Poll indexer `GET .../limit-placements` until **≥ 2** `parked_expired` rows for dev wallet (timeout aligned with existing LCD polls). 2. **Playwright test** in `e2e-tx`: - Navigate `/limits`, assert **`limits-page-claim-all-parked`** visible with **(N ≥ 2)**. - Click → confirm → expect success alert + tx hash. - LCD poll: `claim_expired_limit_orders` batch action present. - Optional: assert parked rows cleared after indexer refresh. 3. **Update** `AGENTS_E2E_LIMIT_ORDERS_TX.md` + `AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md` with runbook and cross-link. ### B. Gas estimate in confirm dialog 1. Extend `confirmExpiredClaimBatchMessage` (or sibling formatter) to append **est. ~X LUNC gas** using `gasLimitForLimitOrderCancelBatch(chunk.length)`. 2. When **N ≥ 2**, optionally append savings vs N singles (reuse / extend `formatLimitBatchGasSavingsLine` semantics for claim path). 3. Update Vitest for new confirm strings; keep messages readable (< ~500 chars) or introduce a lightweight confirm modal component if needed. 4. Document invariant in `docs/limit-orders.md` § #253 follow-up and agent skill. --- ## Acceptance criteria - [ ] **E2E harness** reproducibly creates **≥ 2** indexer `parked_expired` rows for dev wallet on an unpaused pair. - [ ] **Playwright `e2e-tx`** test: **Claim all parked** → one batch tx → LCD shows batch claim wasm action. - [ ] Confirm dialog includes **estimated LUNC fee** for the batch (per chunk when chunked). - [ ] Gas copy uses **`gasLimitForLimitOrderCancelBatch`** / **`estimateFeeUlunaAmountForGasLimit`** only. - [ ] Vitest updated for confirm copy; existing claim-all panel tests still pass. - [ ] Skills + `e2e/README.md` document harness prerequisites and run command. --- ## Test plan — functional paths - [ ] Harness: 2 expired limits → hybrid swap → indexer shows `parked_expired` × 2. - [ ] E2E: claim-all button enabled → confirm → success alert → tx hash link valid. - [ ] E2E: LCD tx contains `claim_expired_limit_orders` (batch attrs). - [ ] Vitest: confirm message includes formatted LUNC estimate for N=2, N=5, chunked N=31 (2 chunks). - [ ] Manual: compare displayed estimate vs actual `gas_used` on LocalTerra (within buffer tolerance). - [ ] `/trade` compact panel: smoke that gas copy path shared with `/limits` (if confirm helper is shared). --- ## Test plan — attack / abuse vectors - [ ] **False fee display:** estimate must not understate `Fee.amount` sent at broadcast (same `effectiveGasPriceUluna` floor as #127). - [ ] **E2E harness:** cannot claim without parked rows (no premature claim-all click success). - [ ] **Paused pair:** E2E skips/fails if pair paused before claim (L6) — no gas burned on doomed tx. - [ ] **Stale indexer:** if harness claims before indexer marks `parked_expired`, test fails loudly (no flaky pass). - [ ] **Chunk loop:** E2E or Vitest documents that each chunk requires separate confirm (no unbounded auto-chaining without user accept). --- ## Verification criteria - [ ] `npm test` — Vitest for `limitExpiredClaimBatch`, `LimitOrderMyPlacementsPanel` (updated confirm copy). - [ ] `bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test <new-spec> --project=e2e-tx` passes with LocalTerra + indexer + deploy + dev-wallet provision. - [ ] CI `e2e-tx` job green (or documented new job step if spec split). - [ ] Manual: 3 parked rows → confirm shows batch gas < 3× single-claim estimate. - [ ] Docs/skills cross-link #253, #246, and this issue. --- ## Related - Parent: [GitLab #253](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/253) (Claim all parked UI) - Batch execute: [GitLab #246](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/246) - Parked lifecycle: [GitLab #141](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/141), [#142](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/142) - E2E strict chain: [GitLab #201](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/201) - Limit tx E2E: [GitLab #195](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/195)
PlasticDigits commented 2026-05-31 13:52:01 +00:00 (Migrated from gitlab.com)

marked as related to #253

marked as related to #253
PlasticDigits commented 2026-05-31 14:32:46 +00:00 (Migrated from gitlab.com)

mentioned in commit 2e6f2cfe29

mentioned in commit 2e6f2cfe2942b698d02d3caf656129b3b85928b5
PlasticDigits commented 2026-05-31 14:32:46 +00:00 (Migrated from gitlab.com)

mentioned in commit 473e0d3a3a

mentioned in commit 473e0d3a3ad1af900249393ec4c80601551e14ec
PlasticDigits commented 2026-05-31 14:32:56 +00:00 (Migrated from gitlab.com)

Implementation complete (merged to main — 473e0d3)

Closed the two gaps from #253 follow-up:

A. Confirm-dialog gas estimate

  • Extended confirmExpiredClaimBatchMessage / new formatExpiredClaimBatchGasLine in frontend-dapp/src/utils/limitExpiredClaimBatch.ts.
  • Uses gasLimitForLimitOrderCancelBatch(chunkSize) + estimateFeeUlunaAmountForGasLimit only (same math as broadcast); optional savings vs N× single CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT.
  • Per-chunk copy when N > 30 (one confirm per chunk unchanged).
  • Vitest updated in limitExpiredClaimBatch.test.ts.

B. Playwright e2e-tx claim-all path

  • Harness: scripts/e2e-seed-expired-parked-claim-all.sh — place 2 expired bids → wait for chain time → hybrid swap parks (limit_order_expired_parked).
  • Helper: frontend-dapp/e2e/helpers/limit-expiry-park-e2e.ts (seed wrapper + indexer poll for parked_expired).
  • Spec: frontend-dapp/e2e/limit-orders-claim-all-tx.spec.ts — /limits Claim all parked → confirm (must include LUNC gas) → LCD claim_expired_limit_orders_batch.

Docs / agent skills

  • docs/limit-orders.md § #253 invariants (confirm gas #259)
  • docs/testing.md, frontend-dapp/e2e/README.md
  • skills/AGENTS_E2E_LIMIT_ORDERS_TX.md, skills/AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md

Verification checklist

  • npm test -- --run src/utils/__tests__/limitExpiredClaimBatch.test.ts — confirm strings for N=2, N=5, chunked N=31
  • Local stack: docker compose up -d localterra + make build-optimized + bash scripts/deploy-dex-local.sh (pair wasm must include claim_expired_limit_orders — #246)
  • Indexer running with CORS for Vite origin (docs/frontend.md § Local dev indexer CORS)
  • bash scripts/e2e-seed-expired-parked-claim-all.sh → indexer shows ≥2 parked_expired for dev wallet
  • bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/limit-orders-claim-all-tx.spec.ts --project=e2e-tx — green end-to-end
  • Manual: confirm dialog shows est. ~X LUNC gas and savings line for Claim all parked (≥2)
  • Manual: compare displayed estimate vs actual gas_used on LocalTerra (within buffer tolerance)

QA agent team

Please run the checklist above on a fresh LocalTerra deploy (stale pair code without batch claim will revert with unknown variant claim_expired_limit_orders). Confirm:

  1. Harness reproducibility (≥2 parked_expired rows)
  2. Playwright e2e-tx spec in CI/local strict chain
  3. Confirm gas copy on /limits and /trade compact panel (shared helper)

Issue left open until QA sign-off.


Follow-up (environment): If deploy-dex-local.sh hits account sequence mismatch under bot swarm, retry after load settles or pause bots — same as other e2e-tx specs (#201).

## Implementation complete (merged to `main` — `473e0d3`) Closed the two gaps from [#253](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/253) follow-up: ### A. Confirm-dialog gas estimate - Extended `confirmExpiredClaimBatchMessage` / new `formatExpiredClaimBatchGasLine` in `frontend-dapp/src/utils/limitExpiredClaimBatch.ts`. - Uses **`gasLimitForLimitOrderCancelBatch(chunkSize)`** + **`estimateFeeUlunaAmountForGasLimit`** only (same math as broadcast); optional savings vs N× single **`CLAIM_EXPIRED_LIMIT_ORDER_GAS_LIMIT`**. - Per-chunk copy when **N > 30** (one confirm per chunk unchanged). - Vitest updated in `limitExpiredClaimBatch.test.ts`. ### B. Playwright `e2e-tx` claim-all path - **Harness:** `scripts/e2e-seed-expired-parked-claim-all.sh` — place 2 expired bids → wait for chain time → hybrid swap parks (`limit_order_expired_parked`). - **Helper:** `frontend-dapp/e2e/helpers/limit-expiry-park-e2e.ts` (seed wrapper + indexer poll for `parked_expired`). - **Spec:** `frontend-dapp/e2e/limit-orders-claim-all-tx.spec.ts` — `/limits` **Claim all parked** → confirm (must include LUNC gas) → LCD `claim_expired_limit_orders_batch`. ### Docs / agent skills - `docs/limit-orders.md` § #253 invariants (confirm gas #259) - `docs/testing.md`, `frontend-dapp/e2e/README.md` - `skills/AGENTS_E2E_LIMIT_ORDERS_TX.md`, `skills/AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md` --- ## Verification checklist - [ ] `npm test -- --run src/utils/__tests__/limitExpiredClaimBatch.test.ts` — confirm strings for N=2, N=5, chunked N=31 - [ ] Local stack: `docker compose up -d localterra` + **`make build-optimized`** + **`bash scripts/deploy-dex-local.sh`** (pair wasm must include **`claim_expired_limit_orders`** — #246) - [ ] Indexer running with CORS for Vite origin (`docs/frontend.md` § Local dev indexer CORS) - [ ] `bash scripts/e2e-seed-expired-parked-claim-all.sh` → indexer shows ≥2 `parked_expired` for dev wallet - [ ] `bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/limit-orders-claim-all-tx.spec.ts --project=e2e-tx` — green end-to-end - [ ] Manual: confirm dialog shows **est. ~X LUNC gas** and savings line for **Claim all parked (≥2)** - [ ] Manual: compare displayed estimate vs actual `gas_used` on LocalTerra (within buffer tolerance) --- ## QA agent team Please run the checklist above on a **fresh LocalTerra deploy** (stale pair code without batch claim will revert with `unknown variant claim_expired_limit_orders`). Confirm: 1. Harness reproducibility (≥2 `parked_expired` rows) 2. Playwright `e2e-tx` spec in CI/local strict chain 3. Confirm gas copy on `/limits` and `/trade` compact panel (shared helper) Issue left **open** until QA sign-off. --- **Follow-up (environment):** If `deploy-dex-local.sh` hits account sequence mismatch under bot swarm, retry after load settles or pause bots — same as other `e2e-tx` specs (#201).
Brouie commented 2026-06-02 16:07:56 +00:00 (Migrated from gitlab.com)

mentioned in issue #253

mentioned in issue #253
Brouie commented 2026-06-02 16:08:29 +00:00 (Migrated from gitlab.com)

mentioned in merge request !736

mentioned in merge request !736
Brouie commented 2026-06-02 16:29:01 +00:00 (Migrated from gitlab.com)

#259 verified — good to close. Checklist against 473e0d3:

Acceptance criteria

  • Harness reproducibly creates >= 2 indexer parked_expired rows for the dev wallet on an unpaused pair — e2e-seed-expired-parked-claim-all.sh -> order 128 @ 2, 129 @ 1.99 -> indexer parked_expired x2.
  • Claim all parked -> one batch tx -> LCD batch claim action — walked it: Claim all parked (2) -> one claim_expired_limit_orders_batch tx -> expired_limit_refund{128,129} both null, refunds returned, rows cleared. (Shipped Playwright spec limit-orders-claim-all-tx.spec.ts automates this in CI e2e-tx.)
  • Confirm dialog includes estimated LUNC fee — live: "Claim all 2 expired refund(s) in one transaction? Est. ~15.86 LUNC gas (saves ~9.630 LUNC vs 2 separate claims)."
  • Gas copy uses gasLimitForLimitOrderCancelBatch / estimateFeeUlunaAmountForGasLimit only — confirmed in terraGas.ts; effectiveGasPriceUluna floor (28.325), same math as broadcast.
  • Vitest updated for confirm copy; claim-all panel tests still pass — limitExpiredClaimBatch.test.ts 5/5 (N=2, N=5, chunked N=31); panel suite 13/13 (after the stale-assertion fix, MR !736).
  • Skills + e2e/README document the harness — #259 cross-links present in docs/limit-orders.md, docs/testing.md, e2e/README.md, AGENTS_E2E_LIMIT_ORDERS_TX.md, AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md.

Verification criteria

  • npm test (limitExpiredClaimBatch + LimitOrderMyPlacementsPanel) — green.
  • Manual: parked rows -> confirm shows batch gas < N x single — "saves ~9.630 LUNC vs 2 separate" = batch 560k vs 2x single.
  • Estimate vs actual gas_used within tolerance — the batch claim succeeded under the 560k gas limit the estimate is built on, so the ~15.86 LUNC display covered actual gas.
  • Docs/skills cross-link #253, #246, #259 — present.
  • False-fee-display vector: estimate cannot understate Fee.amount — it is the same gasLimitForLimitOrderCancelBatch x effectiveGasPriceUluna used at broadcast.
  • /trade compact + /limits share the gas-copy path — both variants call confirmExpiredClaimBatchMessage in LimitOrderMyPlacementsPanel.

The Playwright e2e-tx run on a clean strict-chain host is CI/agent territory; the spec ships in the repo and I confirmed harness reproducibility + walked the full claim-all path. Verified end to end. @PlasticDigits

#259 verified — good to close. Checklist against 473e0d3: Acceptance criteria - [x] Harness reproducibly creates >= 2 indexer parked_expired rows for the dev wallet on an unpaused pair — e2e-seed-expired-parked-claim-all.sh -> order 128 @ 2, 129 @ 1.99 -> indexer parked_expired x2. - [x] Claim all parked -> one batch tx -> LCD batch claim action — walked it: Claim all parked (2) -> one claim_expired_limit_orders_batch tx -> expired_limit_refund{128,129} both null, refunds returned, rows cleared. (Shipped Playwright spec limit-orders-claim-all-tx.spec.ts automates this in CI e2e-tx.) - [x] Confirm dialog includes estimated LUNC fee — live: "Claim all 2 expired refund(s) in one transaction? Est. ~15.86 LUNC gas (saves ~9.630 LUNC vs 2 separate claims)." - [x] Gas copy uses gasLimitForLimitOrderCancelBatch / estimateFeeUlunaAmountForGasLimit only — confirmed in terraGas.ts; effectiveGasPriceUluna floor (28.325), same math as broadcast. - [x] Vitest updated for confirm copy; claim-all panel tests still pass — limitExpiredClaimBatch.test.ts 5/5 (N=2, N=5, chunked N=31); panel suite 13/13 (after the stale-assertion fix, MR !736). - [x] Skills + e2e/README document the harness — #259 cross-links present in docs/limit-orders.md, docs/testing.md, e2e/README.md, AGENTS_E2E_LIMIT_ORDERS_TX.md, AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md. Verification criteria - [x] npm test (limitExpiredClaimBatch + LimitOrderMyPlacementsPanel) — green. - [x] Manual: parked rows -> confirm shows batch gas < N x single — "saves ~9.630 LUNC vs 2 separate" = batch 560k vs 2x single. - [x] Estimate vs actual gas_used within tolerance — the batch claim succeeded under the 560k gas limit the estimate is built on, so the ~15.86 LUNC display covered actual gas. - [x] Docs/skills cross-link #253, #246, #259 — present. - [x] False-fee-display vector: estimate cannot understate Fee.amount — it is the same gasLimitForLimitOrderCancelBatch x effectiveGasPriceUluna used at broadcast. - [x] /trade compact + /limits share the gas-copy path — both variants call confirmExpiredClaimBatchMessage in LimitOrderMyPlacementsPanel. The Playwright e2e-tx run on a clean strict-chain host is CI/agent territory; the spec ships in the repo and I confirmed harness reproducibility + walked the full claim-all path. Verified end to end. @PlasticDigits
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-03 01:59:55 +00:00
PlasticDigits commented 2026-06-05 16:04:17 +00:00 (Migrated from gitlab.com)

mentioned in merge request !821

mentioned in merge request !821
PlasticDigits commented 2026-06-06 09:56:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !831

mentioned in merge request !831
PlasticDigits commented 2026-06-06 09:56:41 +00:00 (Migrated from gitlab.com)

mentioned in issue #292

mentioned in issue #292
PlasticDigits commented 2026-06-08 07:23:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !836

mentioned in merge request !836
PlasticDigits commented 2026-06-08 08:14:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #339

mentioned in issue #339
Brouie commented 2026-06-09 02:17:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#259
No description provided.