test: Playwright e2e-tx matrix for community-tax pair #622

Closed
opened 2026-08-24 05:54:13 +00:00 by PlasticDigits · 19 comments
PlasticDigits commented 2026-08-24 05:54:13 +00:00 (Migrated from gitlab.com)

Parent / siblings

Depends on the LocalTerra community-tax seed + funding + indexer env issue (.env.local pins, Transfer provision, local UST1 stand-in, registered tax/EMBER pair). Parent product: #592, #593, #607, #615, #201.

Existing Create Token Playwright (create-token-602.spec.ts, enable-feature-612.spec.ts, option2-copy-616.spec.ts) is UI-only and bakes columbus-5 launcher pins via e2e/helpers/community-tax-env.ts. Do not treat those as tx coverage.

Current codebase

e2e-tx (1 Playwright worker, shared test1 mnemonic) drives Swap / Pool / Limits / Hybrid / Wrap / fee-tier against the first liquid dual-CW20 gem pair (almost always EMBER/CORAL):

Spec Assumption
swap-tx.spec.ts, swap-route-alignment-tx.spec.ts, trade-market-route-solve-501-tx.spec.ts Wallet debit == Send amount; You Receive == simulation
pool-tx.spec.ts, pool-one-sided-533-tx.spec.ts TransferFrom / zap 1:1
limit-orders-tx.spec.ts (+ gas / claim-all) Place Send 1:1
hybrid-swap.spec.ts, multihop-hybrid-tx.spec.ts CORAL→IRON via EMBER book; no tax hop
wrap-swap.spec.ts, wrap-pool.spec.ts cLUNC/cUSTC only
fee-tier-tx.spec.ts TCL8Y Mint

e2e/global-setup.ts runs e2e-provision-dev-wallet.sh (Mint factory CW20s) + hybrid book seed. Helpers (chain.ts, swap-ui.ts, pool-ui.ts, limit-e2e.ts) fail closed when LCD/funds/pair missing (AGENTS_E2E_STRICT_CHAIN.md). They do not read TaxPreview or community-tax env from .env.local.

community-tax-env.ts defaults VITE_COMMUNITY_TAX_CODE_ID=11611 and the columbus-5 launcher so smoke specs can render /token/create without a local instance.

Why this is needed

Retail paths (Swap Max, You Receive, Trade market route/solve, pool, limits, zap, hybrid, Create/Enable invoices) are what users hit on a listed tax token. Crate tests and #601 LCD smoke do not click the dApp. Gem e2e will not pick the tax pair unless we add explicit specs. Quotes that ignore outbound buy split or extra-debit Max will ship as “the wallet lied.” Router hops must tax the original trader (T592-13) with hybrid always on (#596).

Constraints / guardrails

  • Stay on e2e-tx 1 worker (shared sequence). Do not add tax txs to e2e-smoke as silent skips.
  • Strict chain: missing tax pair / env after seed deploy fails the spec (no test.skip on the default path).
  • Prefer .env.local addresses from the seed issue over columbus-5 bake-in for tx specs. Smoke UI specs may keep columbus-5 fallbacks for /token/create chrome when skip-tax deploy is used.
  • Do not force wrap-swap/pool onto the tax template. Wrap stays cLUNC/cUSTC.
  • Do not add pair/router FoT math or turn hybrid off.
  • Sell Max uses extra-debit (useCommunityTaxSellBps / TaxPreview). Buy You Receive must be net (#615), not raw pair Simulation.
  • Place limit and provide stay 1:1 asserts.
  • Invoice/Create on-chain needs the local UST1 stand-in from the seed issue; do not Send 50 columbus-5 UST1.
  • Pause / blacklist / indexer-outage specs stay on gems unless a tax-specific outage row is added later.

Relevant files

Path Role
frontend-dapp/e2e/swap-tx.spec.ts Direct swap pattern
frontend-dapp/e2e/swap-route-alignment-tx.spec.ts Route vs wasm hops
frontend-dapp/e2e/trade-market-route-solve-501-tx.spec.ts Trade GET /route/solve
frontend-dapp/e2e/pool-tx.spec.ts / pool-one-sided-533-tx.spec.ts LP / zap
frontend-dapp/e2e/limit-orders-tx.spec.ts Place/cancel
frontend-dapp/e2e/hybrid-swap.spec.ts / multihop-hybrid-tx.spec.ts Hybrid / ≥2hop
frontend-dapp/e2e/create-token-602.spec.ts / enable-feature-612.spec.ts UI-only today
frontend-dapp/e2e/helpers/community-tax-env.ts Columbus-5 bake-in
frontend-dapp/e2e/global-setup.ts Provision + hybrid seed
frontend-dapp/src/hooks/useCommunityTaxSellBps.ts Extra-debit Max
frontend-dapp/src/utils/taxPreviewMaxSpend.ts Preview / route hint
frontend-dapp/playwright.config.ts e2e-tx globs
skills/AGENTS_E2E_STRICT_CHAIN.md Strict policy
skills/AGENTS_FRONTEND_HYBRID_ALWAYS_ON.md H596
skills/AGENTS_INDEXER_TAX_AWARE_ROUTING.md R615

Add frontend-dapp/e2e/community-tax-tx.spec.ts (and small helpers e2e/helpers/community-tax-e2e.ts) rather than parameterizing every gem spec:

P0 (must land with this issue)

  1. Swap sell tax → EMBER: Max uses extra-debit; after tx, user debit == preview; pair credit == Send amount; CTA not blocked.
  2. Swap buy EMBER → tax: You Receive is net (outbound split); do not assert raw simulation.
  3. Pool provide + withdraw on tax/EMBER: TransferFrom 1:1.
  4. Limit place + cancel on tax/EMBER: escrow 1:1.

P1 (same issue if time; else unchecked follow-ups in this ticket)

  1. Official-router ≥2hop with tax as offer or hop; copy is option-2 (Buy/sell tax applies on every listed-pair swap), not “route skips tax.”
  2. Trade Market GET /route/solve You Receive matches net rank (R615).
  3. Hybrid on tax/EMBER (always-on); assert fill + tax accounting.
  4. One-sided zap in/out: floors honored (#559); tax on zap hops disclosed.

P2 (document if not implemented)

  1. On-chain Create Token free + paid SKU via PayWithAnyToken (local UST1).
  2. Enable Feature via launcher hook (not direct-to-token).
  3. ExemptionDirectory Max fail-closed (#609).

Do not put tax pairs into multihop-hybrid-tx CORAL→IRON unless the route is explicit.

Acceptance criteria

  • make test-e2e-tx on a seed deploy includes the new spec and fails if the tax pair/env is missing (strict).
  • P0 sell/buy/provide/limit txs pass on LocalTerra with tax asserts (not 1:1 debit on sell/buy).
  • Gem specs still pass (EMBER/CORAL default pair unchanged).
  • PLAYWRIGHT_SKIP_CHAIN=1 does not silently pass tax tx specs (they are e2e-tx only).
  • P1 items done or listed as remaining checkboxes with reason.
  • community-tax-env.ts tx path reads .env.local; smoke-only columbus-5 fallback is documented.
  • make verify-issue-596 / 501 / 533 still green.

Test plan (all paths)

  1. Seed deploy + e2e-provision — tax balance ≥ floor via Transfer; global setup does not Mint tax.
  2. Sell: preview debit, Max button, submit, LCD balances + wasm swap hop.
  3. Buy: UI You Receive == net; LCD user credit + sink == pair debit.
  4. Provide / withdraw: pair CW20 delta == declared.
  5. Limit place/cancel: book row + 1:1 escrow; cancel returns offer without sell tax.
  6. Router ≥2hop (P1): hop order matches Route row; extra-debit on trader.
  7. Trade market (P1): route/solve net ≥ honest alternative when tax is worse.
  8. Hybrid (P1): limit_order_fill still present; tax not double-counted.
  9. Zap (P1): execution follows floors, not optimistic quote.
  10. Skip-tax deploy: tax tx spec fails (strict), not skip.
  11. Create/Enable (P2): 50 UST1 stand-in to launcher; token/launcher hold 0.

Test plan (attack / hack / abuse)

Vector Expect
Quote shows full buy amount, chain pays split Spec fails until You Receive is net
Max spends 100% wallet on a sell (no extra-debit) CTA blocked or Max reduced; tx must not revert mid-broadcast
Spoof trader on pair-direct from the dApp dApp must not set trader unless from == router
Turn hybrid off in the spec to get a green sell Forbidden (#596)
test.skip when tax pair missing Forbidden on default e2e-tx
Invoice 50 UST1 to the token for Enable Feature Reject; launcher path only (T606-7)
Use columbus-5 UST1/launcher on LocalTerra tx Fail closed; local pins required
Zap optimistic quote larger than floor Must not submit (#559)
Limit place treated as sell tax Place is 1:1; extra-debit here is a product bug

Verification

make deploy-local
bash scripts/e2e-start-indexer.sh
CI=1 make test-e2e-tx
# or:
bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test \
  e2e/community-tax-tx.spec.ts --project=e2e-tx

Attach tx hashes / screenshots for sell + buy in the MR. Close when P0 is green on a seed deploy; leave P1/P2 checkboxes explicit.

## Parent / siblings Depends on the LocalTerra **community-tax seed + funding + indexer env** issue (`.env.local` pins, Transfer provision, local UST1 stand-in, registered tax/EMBER pair). Parent product: [#592](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/592), [#593](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/593), [#607](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/607), [#615](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/615), [#201](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/201). Existing Create Token Playwright (`create-token-602.spec.ts`, `enable-feature-612.spec.ts`, `option2-copy-616.spec.ts`) is **UI-only** and bakes columbus-5 launcher pins via `e2e/helpers/community-tax-env.ts`. Do **not** treat those as tx coverage. ## Current codebase `e2e-tx` (1 Playwright worker, shared `test1` mnemonic) drives Swap / Pool / Limits / Hybrid / Wrap / fee-tier against the **first liquid dual-CW20 gem pair** (almost always EMBER/CORAL): | Spec | Assumption | |------|------------| | `swap-tx.spec.ts`, `swap-route-alignment-tx.spec.ts`, `trade-market-route-solve-501-tx.spec.ts` | Wallet debit == Send `amount`; You Receive == simulation | | `pool-tx.spec.ts`, `pool-one-sided-533-tx.spec.ts` | `TransferFrom` / zap 1:1 | | `limit-orders-tx.spec.ts` (+ gas / claim-all) | Place `Send` 1:1 | | `hybrid-swap.spec.ts`, `multihop-hybrid-tx.spec.ts` | CORAL→IRON via EMBER book; no tax hop | | `wrap-swap.spec.ts`, `wrap-pool.spec.ts` | cLUNC/cUSTC only | | `fee-tier-tx.spec.ts` | TCL8Y Mint | `e2e/global-setup.ts` runs `e2e-provision-dev-wallet.sh` (Mint factory CW20s) + hybrid book seed. Helpers (`chain.ts`, `swap-ui.ts`, `pool-ui.ts`, `limit-e2e.ts`) **fail closed** when LCD/funds/pair missing (`AGENTS_E2E_STRICT_CHAIN.md`). They do not read `TaxPreview` or community-tax env from `.env.local`. `community-tax-env.ts` defaults `VITE_COMMUNITY_TAX_CODE_ID=11611` and the columbus-5 launcher so smoke specs can render `/token/create` without a local instance. ## Why this is needed Retail paths (Swap Max, You Receive, Trade market `route/solve`, pool, limits, zap, hybrid, Create/Enable invoices) are what users hit on a listed tax token. Crate tests and `#601` LCD smoke do not click the dApp. Gem e2e will not pick the tax pair unless we add explicit specs. Quotes that ignore outbound buy split or extra-debit Max will ship as “the wallet lied.” Router hops must tax the original trader (**T592-13**) with hybrid **always on** (#596). ## Constraints / guardrails - Stay on `e2e-tx` **1 worker** (shared sequence). Do not add tax txs to `e2e-smoke` as silent skips. - Strict chain: missing tax pair / env after seed deploy **fails** the spec (no `test.skip` on the default path). - Prefer `.env.local` addresses from the seed issue over columbus-5 bake-in for **tx** specs. Smoke UI specs may keep columbus-5 fallbacks for `/token/create` chrome when skip-tax deploy is used. - Do **not** force wrap-swap/pool onto the tax template. Wrap stays cLUNC/cUSTC. - Do **not** add pair/router FoT math or turn hybrid off. - Sell Max uses extra-debit (`useCommunityTaxSellBps` / `TaxPreview`). Buy You Receive must be **net** (#615), not raw pair `Simulation`. - Place limit and provide stay 1:1 asserts. - Invoice/Create on-chain needs the **local UST1 stand-in** from the seed issue; do not Send 50 columbus-5 UST1. - Pause / blacklist / indexer-outage specs stay on gems unless a tax-specific outage row is added later. ## Relevant files | Path | Role | |------|------| | `frontend-dapp/e2e/swap-tx.spec.ts` | Direct swap pattern | | `frontend-dapp/e2e/swap-route-alignment-tx.spec.ts` | Route vs wasm hops | | `frontend-dapp/e2e/trade-market-route-solve-501-tx.spec.ts` | Trade GET `/route/solve` | | `frontend-dapp/e2e/pool-tx.spec.ts` / `pool-one-sided-533-tx.spec.ts` | LP / zap | | `frontend-dapp/e2e/limit-orders-tx.spec.ts` | Place/cancel | | `frontend-dapp/e2e/hybrid-swap.spec.ts` / `multihop-hybrid-tx.spec.ts` | Hybrid / ≥2hop | | `frontend-dapp/e2e/create-token-602.spec.ts` / `enable-feature-612.spec.ts` | UI-only today | | `frontend-dapp/e2e/helpers/community-tax-env.ts` | Columbus-5 bake-in | | `frontend-dapp/e2e/global-setup.ts` | Provision + hybrid seed | | `frontend-dapp/src/hooks/useCommunityTaxSellBps.ts` | Extra-debit Max | | `frontend-dapp/src/utils/taxPreviewMaxSpend.ts` | Preview / route hint | | `frontend-dapp/playwright.config.ts` | `e2e-tx` globs | | `skills/AGENTS_E2E_STRICT_CHAIN.md` | Strict policy | | `skills/AGENTS_FRONTEND_HYBRID_ALWAYS_ON.md` | H596 | | `skills/AGENTS_INDEXER_TAX_AWARE_ROUTING.md` | R615 | ## Recommended direction Add `frontend-dapp/e2e/community-tax-tx.spec.ts` (and small helpers `e2e/helpers/community-tax-e2e.ts`) rather than parameterizing every gem spec: **P0 (must land with this issue)** 1. Swap **sell** tax → EMBER: Max uses extra-debit; after tx, user debit == preview; pair credit == Send amount; CTA not blocked. 2. Swap **buy** EMBER → tax: You Receive is net (outbound split); do not assert raw simulation. 3. Pool provide + withdraw on tax/EMBER: TransferFrom 1:1. 4. Limit place + cancel on tax/EMBER: escrow 1:1. **P1 (same issue if time; else unchecked follow-ups in this ticket)** 5. Official-router ≥2hop with tax as offer or hop; copy is option-2 (`Buy/sell tax applies on every listed-pair swap`), not “route skips tax.” 6. Trade Market `GET /route/solve` You Receive matches net rank (**R615**). 7. Hybrid on tax/EMBER (always-on); assert fill + tax accounting. 8. One-sided zap in/out: floors honored (#559); tax on zap hops disclosed. **P2 (document if not implemented)** 9. On-chain Create Token free + paid SKU via PayWithAnyToken (local UST1). 10. Enable Feature via launcher hook (not direct-to-token). 11. ExemptionDirectory Max fail-closed (#609). Do **not** put tax pairs into `multihop-hybrid-tx` CORAL→IRON unless the route is explicit. ## Acceptance criteria - [ ] `make test-e2e-tx` on a seed deploy includes the new spec and **fails** if the tax pair/env is missing (strict). - [ ] P0 sell/buy/provide/limit txs pass on LocalTerra with tax asserts (not 1:1 debit on sell/buy). - [ ] Gem specs still pass (EMBER/CORAL default pair unchanged). - [ ] `PLAYWRIGHT_SKIP_CHAIN=1` does not silently pass tax **tx** specs (they are `e2e-tx` only). - [ ] P1 items done or listed as remaining checkboxes with reason. - [ ] `community-tax-env.ts` tx path reads `.env.local`; smoke-only columbus-5 fallback is documented. - [ ] `make verify-issue-596` / `501` / `533` still green. ## Test plan (all paths) 1. Seed deploy + `e2e-provision` — tax balance ≥ floor via Transfer; global setup does not Mint tax. 2. Sell: preview debit, Max button, submit, LCD balances + wasm `swap` hop. 3. Buy: UI You Receive == net; LCD user credit + sink == pair debit. 4. Provide / withdraw: pair CW20 delta == declared. 5. Limit place/cancel: book row + 1:1 escrow; cancel returns offer without sell tax. 6. Router ≥2hop (P1): hop order matches Route row; extra-debit on `trader`. 7. Trade market (P1): `route/solve` net ≥ honest alternative when tax is worse. 8. Hybrid (P1): `limit_order_fill` still present; tax not double-counted. 9. Zap (P1): execution follows floors, not optimistic quote. 10. Skip-tax deploy: tax tx spec **fails** (strict), not skip. 11. Create/Enable (P2): 50 UST1 stand-in to **launcher**; token/launcher hold 0. ## Test plan (attack / hack / abuse) | Vector | Expect | |--------|--------| | Quote shows full buy amount, chain pays split | Spec fails until You Receive is net | | Max spends 100% wallet on a sell (no extra-debit) | CTA blocked or Max reduced; tx must not revert mid-broadcast | | Spoof `trader` on pair-direct from the dApp | dApp must not set `trader` unless `from == router` | | Turn hybrid off in the spec to get a green sell | Forbidden (#596) | | `test.skip` when tax pair missing | Forbidden on default `e2e-tx` | | Invoice 50 UST1 to the **token** for Enable Feature | Reject; launcher path only (**T606-7**) | | Use columbus-5 UST1/launcher on LocalTerra tx | Fail closed; local pins required | | Zap optimistic quote larger than floor | Must not submit (#559) | | Limit place treated as sell tax | Place is 1:1; extra-debit here is a product bug | ## Verification ```bash make deploy-local bash scripts/e2e-start-indexer.sh CI=1 make test-e2e-tx # or: bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test \ e2e/community-tax-tx.spec.ts --project=e2e-tx ``` Attach tx hashes / screenshots for sell + buy in the MR. Close when P0 is green on a seed deploy; leave P1/P2 checkboxes explicit.
PlasticDigits commented 2026-08-24 05:54:15 +00:00 (Migrated from gitlab.com)

marked as related to #620

marked as related to #620
PlasticDigits commented 2026-08-24 05:54:15 +00:00 (Migrated from gitlab.com)

marked as related to #201

marked as related to #201
PlasticDigits commented 2026-08-24 05:54:16 +00:00 (Migrated from gitlab.com)

marked as related to #592

marked as related to #592
PlasticDigits commented 2026-08-24 05:54:17 +00:00 (Migrated from gitlab.com)

marked as related to #593

marked as related to #593
PlasticDigits commented 2026-08-24 05:54:17 +00:00 (Migrated from gitlab.com)

marked as related to #607

marked as related to #607
PlasticDigits commented 2026-08-24 05:54:18 +00:00 (Migrated from gitlab.com)

marked as related to #615

marked as related to #615
PlasticDigits commented 2026-08-24 05:54:18 +00:00 (Migrated from gitlab.com)

marked as related to #596

marked as related to #596
PlasticDigits commented 2026-08-24 05:54:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #620

mentioned in issue #620
PlasticDigits commented 2026-08-24 05:54:34 +00:00 (Migrated from gitlab.com)

marked as related to #621

marked as related to #621
PlasticDigits commented 2026-08-24 05:54:36 +00:00 (Migrated from gitlab.com)

marked as related to #623

marked as related to #623
PlasticDigits commented 2026-08-24 06:19:37 +00:00 (Migrated from gitlab.com)

mentioned in issue #624

mentioned in issue #624
PlasticDigits commented 2026-08-24 06:31:43 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1133

mentioned in merge request !1133
PlasticDigits commented 2026-08-24 06:55:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 1c3440335b

mentioned in commit 1c3440335b20f7fdf5276b1405ba1aecf59fd344
PlasticDigits commented 2026-08-24 06:55:15 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1135

mentioned in merge request !1135
PlasticDigits commented 2026-08-24 07:00:29 +00:00 (Migrated from gitlab.com)

mentioned in commit 5f683cfe9f

mentioned in commit 5f683cfe9f4c69438d1f3c7760a8e61ffb22e800
PlasticDigits commented 2026-08-24 07:00:38 +00:00 (Migrated from gitlab.com)

mentioned in commit 01cd541b65

mentioned in commit 01cd541b653e00dfe109db38b423c718d22fd53b
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-08-24 07:00:38 +00:00
PlasticDigits commented 2026-08-24 07:02:07 +00:00 (Migrated from gitlab.com)

Merge note (!1135)

Merged to main as !1135 (01cd541b) after resolving conflicts with !1133/#621 and !1134/#623 (docs/Makefile/AGENTS.md only). Did not wait for CI; jobs failed with ci_quota_exceeded.

Sanity on this tip

make verify-issue-622 6/6 static + unit (funding-kind + 14 Vitest). Live Playwright was not re-run (VERIFY_ISSUE_622_CHAIN unset).

Remaining (do not reopen this ticket)

The MR already recorded a P0 sell extra-debit miss on this shared LocalTerra: user debit 100000 vs TaxPreview 105000 while the indexer was down, and leftover #623 tax pairs filled pairs[0]. Still needed on a fresh make deploy-local + indexer:

  • P0 sell LCD debit == TaxPreview; buy You Receive net; provide/withdraw 1:1; limit place/cancel 1:1
  • Attach sell + buy screenshots
  • Skip-tax deploy: spec fails closed (no test.skip)
  • Optional: make verify-issue-533 live P4–P8 after leftover tax tokens are gone from gem pickers

Tracked on the new post-merge issue for !1133–!1135.

## Merge note (!1135) Merged to `main` as [!1135](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/417) (`01cd541b`) after resolving conflicts with !1133/#621 and !1134/#623 (docs/`Makefile`/`AGENTS.md` only). Did not wait for CI; jobs failed with `ci_quota_exceeded`. ### Sanity on this tip `make verify-issue-622` **6/6** static + unit (funding-kind + 14 Vitest). Live Playwright was **not** re-run (`VERIFY_ISSUE_622_CHAIN` unset). ### Remaining (do not reopen this ticket) The MR already recorded a **P0 sell extra-debit miss** on this shared LocalTerra: user debit `100000` vs `TaxPreview` `105000` while the indexer was down, and leftover #623 tax pairs filled `pairs[0]`. Still needed on a **fresh** `make deploy-local` + indexer: - P0 sell LCD debit == TaxPreview; buy You Receive net; provide/withdraw 1:1; limit place/cancel 1:1 - Attach sell + buy screenshots - Skip-tax deploy: spec fails closed (no `test.skip`) - Optional: `make verify-issue-533` live P4–P8 after leftover tax tokens are gone from gem pickers Tracked on the new post-merge issue for !1133–!1135.
PlasticDigits commented 2026-08-24 07:02:37 +00:00 (Migrated from gitlab.com)

mentioned in issue #625

mentioned in issue #625
PlasticDigits commented 2026-08-24 07:02:37 +00:00 (Migrated from gitlab.com)

marked as related to #625

marked as related to #625
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#622
No description provided.