Skip to content

fix: AbiError.decode resolves overloads by selector - #602

Merged
jxom merged 1 commit into
mainfrom
fix/abi-error-decode-overloads
Nov 8, 2026
Merged

jxom merged 1 commit into
mainfrom
fix/abi-error-decode-overloads

Conversation

@jxom

@jxom jxom commented Nov 8, 2026

Copy link
Copy Markdown
Member

Follow-up to #598 / #599.

AbiError.decode(abi, name, data) ignored overloads: it decoded data with whichever overload fromAbi picked by name. With error Example() + error Example(uint256), decoding Example(uint256) data by name returned undefined; with several non-zero overloads it decoded with the wrong parameters.

  • AbiError.decode now resolves the overload from the selector in data, like AbiFunction.decodeData.
  • decode.ReturnType distributes over the error and its overloads (bigint | string | undefined for Example() / Example(uint256) / Example(string)).

AbiError.decode(abi, name, data) decoded with whichever overload fromAbi
picked by name, so data for another overload of the same error decoded as
undefined or with the wrong parameters. It now resolves the overload from
the selector in data, like AbiFunction.decodeData, and its return type
includes the overloads' inputs.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-e129-76ad-b0c4-3188e7e62ad9
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 Error Error Nov 8, 2026 8:19pm 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-08T20:20:30.972359Z 9a7d9cd 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-602-9a7d9cd under the pr-602 dist-tag, which follows this pull request until it closes.

pnpm add ox@pr-602
pnpm add ox@0.0.0-pr-602-9a7d9cd

@jxom
jxom merged commit 15ef7a4 into main Nov 8, 2026
15 of 16 checks passed
@jxom
jxom deleted the fix/abi-error-decode-overloads branch November 8, 2026 20:28
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026

This branch had an error being deployed

1 failed deployment
Preview — 9a7d9cda 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