test(web): cover EVM account= matching path and WC/deeplink bind #33

Merged
PlasticDigits merged 1 commit from test/16-evm-account-continuity into main 2026-08-31 04:56:55 +00:00
PlasticDigits commented 2026-08-31 04:41:30 +00:00 (Migrated from gitlab.com)

Closes #16

Summary

  • Prove the voting / SDK 0.1.1 integrator path: matching account= + the connected injected mock records that address (signed_latest for the claimed 0x…, including EIP-55 vs lowercase).
  • Cover WalletConnect mismatch (no personal_sign / no Accepted), Open in MetaMask / Binance / Copy link account= preservation, and hostile account= (javascript:, terra1…) as text-only fail-closed.
  • Do not reimplement assertEvmAccountContinuity. Portal bind stays UX; API EIP-191 recover is unchanged. Skills + README + clickwrap README cross-link the new cases for third-party agent players.

Acceptance criteria

  • Matching account= + same injected mock → accept records that account, not a sibling provider.
  • Matching checksum vs lowercase claimed vs connected still succeeds.
  • Mismatch injected (already present) stays green.
  • Mismatch WalletConnect does not submit and does not show Accepted.
  • Open in MetaMask / Binance / Copy link preserve account= from the current portal search; they never use account as an href target.
  • Hostile account query is not executed / not used as navigation; bind still fail-closed.
  • No claim (account absent) still signs the connected wallet (existing tests).
  • API verify unchanged; no new trust of query account on POST.
  • Skills/test map mention the new cases.
  • cd web && npx vitest run src/evm src/query.test.ts and npm run test:e2e -- evm-sign (Playwright workers=5) green.

Test plan

Path Artifact
Match (lower + EIP-55) evm-sign.spec.ts matching lowercase / EIP-55
Already signed + match already-signed matching account= skips personal_sign
Sibling EIP-6963 pick Binance (other 0x) → mismatch; pick MetaMask → Accepted
WC mismatch unit walletConnect.test.ts + e2e WC mock
Deeplink account= e2e + deeplinkUi.test.ts
Hostile / terra1 unit account.test.ts + e2e
No claim existing injected / EIP-6963 / WC / late-inject tests

Local verify

cd web && npx vitest run src/evm src/query.test.ts
cd web && npm run test:e2e -- evm-sign   # playwright.config.ts workers=5
# If 5173 is already taken: PLAYWRIGHT_WEB_PORT=5174 npm run test:e2e -- evm-sign

Out of scope (issue)

  • Solana / Telegram account= bind (#2 / #4)
  • Re-doing #15 mobile discovery
  • Changing EIP-191 verify
  • Production spot-check of terms.cl8y.com (optional ops)
  • Real MetaMask in CI
Closes #16 ## Summary - Prove the voting / SDK **0.1.1** integrator path: matching `account=` + the connected injected mock records **that** address (`signed_latest` for the claimed `0x…`, including EIP-55 vs lowercase). - Cover WalletConnect mismatch (no `personal_sign` / no Accepted), Open in MetaMask / Binance / Copy link `account=` preservation, and hostile `account=` (`javascript:`, `terra1…`) as text-only fail-closed. - Do **not** reimplement `assertEvmAccountContinuity`. Portal bind stays UX; API EIP-191 recover is unchanged. Skills + README + clickwrap README cross-link the new cases for third-party agent players. ## Acceptance criteria - [x] Matching `account=` + same injected mock → accept records **that** account, not a sibling provider. - [x] Matching checksum vs lowercase claimed vs connected still succeeds. - [x] Mismatch injected (already present) stays green. - [x] Mismatch WalletConnect does not submit and does not show Accepted. - [x] Open in MetaMask / Binance / Copy link preserve `account=` from the current portal search; they never use `account` as an href target. - [x] Hostile `account` query is not executed / not used as navigation; bind still fail-closed. - [x] No claim (`account` absent) still signs the connected wallet (existing tests). - [x] API verify unchanged; no new trust of query `account` on POST. - [x] Skills/test map mention the new cases. - [x] `cd web && npx vitest run src/evm src/query.test.ts` and `npm run test:e2e -- evm-sign` (Playwright workers=5) green. ## Test plan | Path | Artifact | |------|----------| | Match (lower + EIP-55) | `evm-sign.spec.ts` matching lowercase / EIP-55 | | Already signed + match | `already-signed matching account= skips personal_sign` | | Sibling EIP-6963 | pick Binance (other `0x`) → mismatch; pick MetaMask → Accepted | | WC mismatch | unit `walletConnect.test.ts` + e2e WC mock | | Deeplink `account=` | e2e + `deeplinkUi.test.ts` | | Hostile / `terra1` | unit `account.test.ts` + e2e | | No claim | existing injected / EIP-6963 / WC / late-inject tests | ## Local verify ```bash cd web && npx vitest run src/evm src/query.test.ts cd web && npm run test:e2e -- evm-sign # playwright.config.ts workers=5 # If 5173 is already taken: PLAYWRIGHT_WEB_PORT=5174 npm run test:e2e -- evm-sign ``` ## Out of scope (issue) - Solana / Telegram `account=` bind (#2 / #4) - Re-doing #15 mobile discovery - Changing EIP-191 verify - Production spot-check of `terms.cl8y.com` (optional ops) - Real MetaMask in CI
PlasticDigits commented 2026-08-31 04:56:55 +00:00 (Migrated from gitlab.com)

mentioned in commit 45f4ea5b61

mentioned in commit 45f4ea5b610bfae7a3c54c354199eebd7725957e
PlasticDigits (Migrated from gitlab.com) merged commit 45f4ea5b61 into main 2026-08-31 04:56:55 +00:00
PlasticDigits commented 2026-08-31 04:58:07 +00:00 (Migrated from gitlab.com)

mentioned in issue #16

mentioned in issue #16
PlasticDigits commented 2026-08-31 04:58:23 +00:00 (Migrated from gitlab.com)

mentioned in issue #18

mentioned in issue #18
Sign in to join this conversation.
No reviewers
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-ecosystem-legal!33
No description provided.