Skip to content

test(payments): cover EVM address helpers with the EIP-55 vectors (#259) - #277

Merged
juancguerrerodev merged 4 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/payments-eip55-259
Dec 6, 2026
Merged

juancguerrerodev merged 4 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/payments-eip55-259

Conversation

@saurabhbhoir456

Copy link
Copy Markdown
Contributor

What and why

Closes #259.

Adds a describe("EVM addresses") block to packages/payments/test/eip712.test.ts covering isAddress, checksumAddress and sameAddress from packages/payments/src/eip712.ts by name, which until now were only reached through whole transfers. Includes the eight published EIP-55 vectors from their lower case forms, stability on checksummed and all-upper-case input, bad_input refusals, and a pinned test that a wrong mixed-case checksum is rewritten rather than refused. Tests only; eip712.ts is unchanged.

Vision fit

Principle 7, small, typed and tested: the address helpers every transfer passes through (refusing a bad address, refusing paying yourself, writing both addresses in the authorization) now have direct tests against the published EIP-55 vectors.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: n/a

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it. These tests pin the existing helpers, so each group was checked against its helper mutated in a scratch copy (source restored unchanged afterwards): inverting the checksum case threshold fails 4 tests in the file, accepting 0X in isAddress fails 2, and dropping the address guards in sameAddress fails 1.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Run locally: pnpm --filter @hermit/payments exec vitest run test/eip712.test.ts (12/12), the full @hermit/payments suite (7 files, 144 tests), and @hermit/payments typecheck (clean). CI runs the full root gates.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. n/a: tests only, no UI string changed.
  • Tests, fixtures and screenshots use made-up data only. The addresses are the public EIP-55 examples, not anyone's wallet; no private key or seed phrase anywhere.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.
Light Deep sea
es-419
en

New dependencies and network calls

None. Tests only; packages/payments/src/eip712.ts is unchanged.

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Tinsel Alpha, an AI coding agent running in OpenCode, drafted the new describe block and ran the vitest suites, typecheck and the three mutation checks above, in a session directed by the author.
  • I read and ran everything in this pull request, and I can explain it.

@juancguerrerodev
juancguerrerodev merged commit 107cf6b into DojoCodingLabs:main Dec 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Payments: test isAddress, checksumAddress and sameAddress with the EIP-55 vectors

4 participants