Skip to content

test(AbiEvent): pin range checks for narrow indexed topic args - #589

Merged
jxom merged 1 commit into
0.xfrom
fix/abi-event-topic-range-v0
Nov 8, 2026
Merged

jxom merged 1 commit into
0.xfrom
fix/abi-event-topic-range-v0

Conversation

@jxom

@jxom jxom commented Nov 8, 2026

Copy link
Copy Markdown
Member

Companion to #588 on main, which supersedes #502.

On main, AbiEvent.encode accepted out-of-range indexed intN/uintN and wrong-sized bytesN arguments because a fast path skipped AbiParameters.encode. 0.x never had that fast path: every indexed primitive already goes through AbiParameters.encode, so it already rejects these values. I checked int8 128/-129, uint8 256, bytes4 with 5 or 2 bytes, and bytes32 with 2 or 31 bytes; all of them throw.

This PR adds only the regression tests from #588, so a later backport of the fast path can't bring the bug to 0.x. There's no behavior change, so there's no changeset.

Checks

  • AbiEvent.test.ts and AbiParameters.test.ts: 107 passed, with the Anvil-only behavior: network cases excluded. The inline snapshots match main exactly.
  • tsc --noEmit and biome check on the test file pass.

Co-authored-by: watarus <9610999+watarus@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-d1c9-702d-86cc-68140700196a
Co-authored-by: jxom <jake@tempo.xyz>
@vercel

vercel Bot commented Nov 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ox Building Building Preview Nov 8, 2026 7:51pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T19:52:11.620687Z bd016f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Published ox@0.0.0-pr-589-bd016f9 under the pr-589 dist-tag, which follows this pull request until it closes.

pnpm add ox@pr-589
pnpm add ox@0.0.0-pr-589-bd016f9

@jxom
jxom merged commit a9940d1 into 0.x Nov 8, 2026
13 of 14 checks passed
@jxom
jxom deleted the fix/abi-event-topic-range-v0 branch November 8, 2026 19:56

This branch was successfully deployed

1 active deployment
Preview — bd016f92 Deployed Nov 8, 2026 by vercel[bot]
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.

2 participants