Testing: indexer hybrid attrs, book-leg discount, Vitest hybrid msgs, pause+limits, smoke, stubs, charts #199

Closed
opened 2026-05-26 08:00:36 +00:00 by PlasticDigits · 6 comments
PlasticDigits commented 2026-05-26 08:00:36 +00:00 (Migrated from gitlab.com)

Problem statement

Several P2 test gaps from the production review remain open. This epic tracks them in one deliverable so CI gains meaningful coverage without one-off issue noise.

Scope (consolidated)

Area Gap Suggested test
Indexer Hybrid swap wasm attrs on swap_events Fixture tx JSON → book_return_amount, limit_book_offer_consumed, effective_fee_bps (#82)
Contracts Fee discount on book leg effective_fee_bps on match path matches pool path for same trader (#83)
Frontend SwapPage / router hybrid message shape Vitest guards construction (#84)
Contracts + E2E Pause blocks swap + limits + cancel UX Integration + optional E2E banner (#87)
Infra Post-deploy smoke script Manual or optional CI job (#86)
Docs + tests Stubs/mocks catalog Policy in docs/testing.md (#105)
Frontend Charts integration (not jsdom-only) Vitest integration config or dedicated suite (#104)

Evidence / context

Acceptance criteria

  • Each row above has at least one automated test (or documented manual gate for smoke only).
  • docs/testing.md updated with stub policy and how to run integration/charts suites.
  • CI runs new tests on PR (no #[ignore] without linked follow-up).

Priority

P2

## Problem statement Several **P2 test gaps** from the production review remain open. This epic tracks them in one deliverable so CI gains meaningful coverage without one-off issue noise. ## Scope (consolidated) | Area | Gap | Suggested test | |------|-----|----------------| | Indexer | Hybrid swap wasm attrs on `swap_events` | Fixture tx JSON → `book_return_amount`, `limit_book_offer_consumed`, `effective_fee_bps` (**#82**) | | Contracts | Fee discount on **book** leg | `effective_fee_bps` on match path matches pool path for same trader (**#83**) | | Frontend | `SwapPage` / router **hybrid message shape** | Vitest guards construction (**#84**) | | Contracts + E2E | **Pause** blocks swap + limits + cancel UX | Integration + optional E2E banner (**#87**) | | Infra | **Post-deploy smoke** script | Manual or optional CI job (**#86**) | | Docs + tests | **Stubs/mocks catalog** | Policy in [`docs/testing.md`](docs/testing.md) (**#105**) | | Frontend | **Charts** integration (not jsdom-only) | Vitest integration config or dedicated suite (**#104**) | ## Evidence / context - [TEST_GAP_MATRIX.md](docs/reviews/20260409T030009Z/TEST_GAP_MATRIX.md) - [`indexer/src/indexer/parser.rs`](indexer/src/indexer/parser.rs); [`smartcontracts/tests/src/limit_order_tests.rs`](smartcontracts/tests/src/limit_order_tests.rs) ## Acceptance criteria - [ ] Each row above has at least one automated test (or documented manual gate for smoke only). - [ ] [`docs/testing.md`](docs/testing.md) updated with stub policy and how to run integration/charts suites. - [ ] CI runs new tests on PR (no `#[ignore]` without linked follow-up). ## Priority **P2**
PlasticDigits commented 2026-05-26 10:11:00 +00:00 (Migrated from gitlab.com)

mentioned in commit aef9c581a2

mentioned in commit aef9c581a2ae32a6334c7ea94fa36fefc9791eba
PlasticDigits commented 2026-05-26 10:11:17 +00:00 (Migrated from gitlab.com)

Summary (GitLab #199 — P2 testing epic)

Merged to main in commit aef9c58.

This epic consolidated production-review P2 test gaps. Most rows already had automated coverage from prior issues (#82–#87, #104–#105); this delivery closes the remaining doc/cross-link gaps and adds two targeted Vitest regressions:

New tests

  • router.hybrid.test.ts — guards executeMultiHopSwap / serializeTerraSwap hybrid fields on router execute_swap_operations (#84).
  • TradePage.test.tsx — pause banner + disabled limit submit when getPairPaused returns { paused: true } (#87 / L6).

Documentation & agent playbooks

Pre-existing automated evidence (unchanged, now cross-linked)

Row Evidence
Indexer hybrid attrs (#82) indexer/tests/swap_events_hybrid_columns.rs + parser unit tests
Book-leg fee discount (#83) hybrid_book_fill_uses_taker_discounted_effective_fee_bps
Direct pair hybrid msgs (#84) pair.test.ts + routeOperations.test.ts
Pause contract (#87) pause_blocks_swap_and_place_cancel_refunds_escrow
Smoke (#86) scripts/smoke-pool-swap.sh (manual gate)
Stubs (#105) policy in docs/testing.md + issue #105
Charts (#104) ChartsPage.integration.test.tsx + CI test:integration

Verification checklist

Please confirm:

  • cd frontend-dapp && npm run test:run -- router.hybrid.test.ts TradePage.test.tsx passes
  • cd smartcontracts && cargo test hybrid_book_fill_uses_taker_discounted_effective_fee_bps pause_blocks_swap_and_place_cancel_refunds_escrow passes
  • With Postgres: cd indexer && cargo test --test swap_events_hybrid_columns -j 1 -- --test-threads=1 passes
  • Docs links resolve: docs/testing.md#p2-testing-epic-gitlab-199, skills/AGENTS_TESTING_P2_EPIC.md
  • Optional manual: ./scripts/smoke-pool-swap.sh with PAIR_ADDR (+ OFFER_TOKEN) after deploy
  • Optional CI path: frontend charts integration job (npm run test:integration) with seeded DB

@brouie — please verify the checklist above when you have a moment. Leaving this issue open until sign-off.

## Summary (GitLab #199 — P2 testing epic) Merged to `main` in commit `aef9c58`. This epic consolidated production-review P2 test gaps. Most rows already had automated coverage from prior issues (#82–#87, #104–#105); this delivery **closes the remaining doc/cross-link gaps** and adds two targeted Vitest regressions: ### New tests - **`router.hybrid.test.ts`** — guards `executeMultiHopSwap` / `serializeTerraSwap` hybrid fields on router `execute_swap_operations` (#84). - **`TradePage.test.tsx`** — pause banner + disabled limit submit when `getPairPaused` returns `{ paused: true }` (#87 / L6). ### Documentation & agent playbooks - [`docs/testing.md`](docs/testing.md) — new **P2 testing epic (#199)** table + smoke script instructions (#86). - [`docs/indexer-invariants.md`](docs/indexer-invariants.md) — hybrid swap columns indexing row (#82). - [`docs/contracts-security-audit.md`](docs/contracts-security-audit.md) — L6 links frontend pause Vitest. - [`docs/reviews/20260409T030009Z/TEST_GAP_MATRIX.md`](docs/reviews/20260409T030009Z/TEST_GAP_MATRIX.md) — rows marked **covered**. - [`skills/AGENTS_TESTING_P2_EPIC.md`](skills/AGENTS_TESTING_P2_EPIC.md) — third-party agent coverage map + commands. ### Pre-existing automated evidence (unchanged, now cross-linked) | Row | Evidence | |-----|----------| | Indexer hybrid attrs (#82) | `indexer/tests/swap_events_hybrid_columns.rs` + parser unit tests | | Book-leg fee discount (#83) | `hybrid_book_fill_uses_taker_discounted_effective_fee_bps` | | Direct pair hybrid msgs (#84) | `pair.test.ts` + `routeOperations.test.ts` | | Pause contract (#87) | `pause_blocks_swap_and_place_cancel_refunds_escrow` | | Smoke (#86) | `scripts/smoke-pool-swap.sh` (manual gate) | | Stubs (#105) | policy in `docs/testing.md` + issue #105 | | Charts (#104) | `ChartsPage.integration.test.tsx` + CI `test:integration` | --- ## Verification checklist Please confirm: - [ ] `cd frontend-dapp && npm run test:run -- router.hybrid.test.ts TradePage.test.tsx` passes - [ ] `cd smartcontracts && cargo test hybrid_book_fill_uses_taker_discounted_effective_fee_bps pause_blocks_swap_and_place_cancel_refunds_escrow` passes - [ ] With Postgres: `cd indexer && cargo test --test swap_events_hybrid_columns -j 1 -- --test-threads=1` passes - [ ] Docs links resolve: `docs/testing.md#p2-testing-epic-gitlab-199`, `skills/AGENTS_TESTING_P2_EPIC.md` - [ ] Optional manual: `./scripts/smoke-pool-swap.sh` with `PAIR_ADDR` (+ `OFFER_TOKEN`) after deploy - [ ] Optional CI path: frontend charts integration job (`npm run test:integration`) with seeded DB @brouie — please verify the checklist above when you have a moment. Leaving this issue **open** until sign-off.
PlasticDigits commented 2026-05-27 12:31:46 +00:00 (Migrated from gitlab.com)

Verification sign-off (agent)

Verified all checklist items on local stack (LocalTerra block ~131698, host Postgres :5432, indexer :3001, bot swarm 30/30).

Checklist results

  • npm run test:run -- router.hybrid.test.ts TradePage.test.tsx — 20/20 passed
  • cargo test hybrid_book_fill_uses_taker_discounted_effective_fee_bps — passed
  • cargo test pause_blocks_swap_and_place_cancel_refunds_escrow — passed
  • cargo test --test swap_events_hybrid_columns -j 1 -- --test-threads=1 — passed
  • Docs links resolve: docs/testing.md#p2-testing-epic-gitlab-199, skills/AGENTS_TESTING_P2_EPIC.md
  • ./scripts/smoke-pool-swap.sh — pool + hybrid_simulation OK (EMBER/CORAL pair)
  • npm run test:integration — 7/7 passed (after seeding indexer/scripts/seed-charts-integration.sql into dex_indexer for local charts candle row)

Browser verification (http://127.0.0.1:5176)

  • Charts — "Charts & Analytics" shell renders; no indexer-down alert banner
  • Trade — pair workspace loads (EMBER/CORAL), limit ticket + chart shell present; pause UX covered by Vitest (TradePage.test.tsx)

No code defects found; P2 epic acceptance criteria satisfied. Closing.

## Verification sign-off (agent) Verified all checklist items on local stack (LocalTerra block ~131698, host Postgres :5432, indexer :3001, bot swarm 30/30). ### Checklist results - [x] `npm run test:run -- router.hybrid.test.ts TradePage.test.tsx` — 20/20 passed - [x] `cargo test hybrid_book_fill_uses_taker_discounted_effective_fee_bps` — passed - [x] `cargo test pause_blocks_swap_and_place_cancel_refunds_escrow` — passed - [x] `cargo test --test swap_events_hybrid_columns -j 1 -- --test-threads=1` — passed - [x] Docs links resolve: `docs/testing.md#p2-testing-epic-gitlab-199`, `skills/AGENTS_TESTING_P2_EPIC.md` - [x] `./scripts/smoke-pool-swap.sh` — pool + hybrid_simulation OK (EMBER/CORAL pair) - [x] `npm run test:integration` — 7/7 passed (after seeding `indexer/scripts/seed-charts-integration.sql` into dex_indexer for local charts candle row) ### Browser verification (http://127.0.0.1:5176) - **Charts** — "Charts & Analytics" shell renders; no indexer-down alert banner - **Trade** — pair workspace loads (EMBER/CORAL), limit ticket + chart shell present; pause UX covered by Vitest (`TradePage.test.tsx`) No code defects found; P2 epic acceptance criteria satisfied. Closing.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 12:31:51 +00:00
PlasticDigits commented 2026-05-27 12:37:11 +00:00 (Migrated from gitlab.com)

mentioned in issue #205

mentioned in issue #205
PlasticDigits commented 2026-05-29 03:11:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #210

mentioned in issue #210
PlasticDigits commented 2026-05-29 03:13:21 +00:00 (Migrated from gitlab.com)

mentioned in issue #211

mentioned in issue #211
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#199
No description provided.