Repository navigation
fix(0.x): port recent viem fixes to AbiItem, AbiEvent, TypedData, Hex, and RpcTransport - #527
Conversation
Ports wevm/viem#5240. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports wevm/viem#5283. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports wevm/viem#5281. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports wevm/viem#5238 and wevm/viem#5280. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
…ith a caller signal Ports wevm/viem#5200. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
(cherry picked from commit 36dce4a)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f470db61a6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // Read the body within the timeout too, so a response that stalls | ||
| // after its headers cannot hang the request. | ||
| const data = await (async () => { |
There was a problem hiding this comment.
Preserve caller aborts while reading the response body
When response headers have arrived but response.json() or response.text() is still pending, aborting fetchOptions.signal now rejects the body read with AbortError inside promise.withTimeout; that helper converts every AbortError into Promise.TimeoutError. Before this change the body was read outside the timeout wrapper, so this phase propagated the caller's abort normally. Distinguish the timeout controller from the caller signal so user cancellation is not reported as a timeout.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Keeping this as is. A caller abort already rejects with Promise.TimeoutError before the response headers arrive, and the existing options: signal test asserts that. Reading the body inside withTimeout gives the body phase the same behavior. Reporting caller aborts separately would change promise.withTimeout, and with it the abort error this transport has always returned. That's out of scope for this backport, and main behaves the same way.
Generated by Claude Code
…m.fromAbi` overloads Syncs with the merged wevm/viem#5281: tuple object args are read by component name, and an empty array is ambiguous for `address[]` vs `string[]`/`bytes[]`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Ports the `Variable` case of `getLinkForApiItem` from `main` (#414). Without it, the `{@link ox#AccountConfig.maxSignatures}` reference added in #509 fails `docs:gen` and every `0.x` docs deployment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
|
The Generated by Claude Code |
…Transport.fromHttp` `AbortSignal.any` is missing on Node < 18.17 and older browsers, which the 0.x line supports. There, the transport now uses the caller signal alone, as it did before, instead of throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
…Transport.fromHttp` Matches the 0.x backport (#527): runtimes without `AbortSignal.any` (Node < 18.17, older browsers) use the caller signal alone instead of throwing. Also aligns the `AbiEvent.assertArgs` test and the `getComponentValue` comment with 0.x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
Matches the main-branch test in #526. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b
…ypedData`, `Hex`, and `RpcTransport` (#526) * fix: keep empty `version` in `TypedData.extractEip712DomainTypes` Ports wevm/viem#5240. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * feat: add `even` option to `Hex.assert` and `Hex.validate` Ports wevm/viem#5283. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: left-pad short `r` and `s` in `Signature.toHex` Ports wevm/viem#5279. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: array overload resolution in `AbiItem.fromAbi` Ports wevm/viem#5281. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: `AbiEvent.assertArgs` and `AbiEvent.extractLogs` `args` matching Ports wevm/viem#5280. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: apply `RpcTransport.fromHttp` timeout to the response body Ports wevm/viem#5200. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: read tuple object args by name and match empty arrays in `AbiItem.fromAbi` overloads Syncs with the merged wevm/viem#5281: tuple object args are read by component name, and an empty array is ambiguous for `address[]` vs `string[]`/`bytes[]`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b * fix: keep the caller signal when `AbortSignal.any` is missing in `RpcTransport.fromHttp` Matches the 0.x backport (#527): runtimes without `AbortSignal.any` (Node < 18.17, older browsers) use the caller signal alone instead of throwing. Also aligns the `AbiEvent.assertArgs` test and the `getComponentValue` comment with 0.x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b --------- Co-authored-by: Claude <noreply@anthropic.com>
Backports #526 to
0.x, adapted to the0.xcode and in sync with viemmainat 2867b2a. It also includes #516, which0.xnever received.0.xchangeTypedData.extractEip712DomainTypeskeeps an emptyversion. Same asmain.Hex.assert/Hex.validateevenoption. Same asmain.AbiItem.fromAbiarray overload resolution, tuple object args read by component name, and empty-array ambiguity foraddress[]vsstring[]/bytes[]. Same asmain, keeping the inline regexes of0.x.AbiEvent.assertArgs: indexedstringargs never matched, sinceHash.keccak256(Bytes)returns bytes on0.x. They now hash to hex, as onmain. Non-indexedstring/bytesnow match by value, andbytes/bytesNmatch in either hex case.0.xhas noextractLogs, so onlyassertArgschanges.RpcTransport.fromHttpappliestimeoutto the response body. It also keeps the timeout whenfetchOptions.signalis set, using theAbortSignal.anycomposition frommain.normalizeSignaturefix (keeps the first parameter after().Variablelink case frommain. Without it, every0.xdocs deployment has failed since #509.Not included: the
Signature.toHexpadding frommain.0.xstoresr/sas bigints and already serializes them withHex.fromNumber(…, { size: 32 }).Validation:
pnpm check,pnpm check:types,pnpm check:tsdoc,pnpm docs:gen, andpnpm --filter site buildpass. The changed suites pass in thecoreproject without Anvil global setup, except existing tests that need a local Anvil node, which wasn't available. The newAbiEvent,AbiItem, andRpcTransporttests were confirmed to fail without their fixes.🤖 Generated with Claude Code
https://claude.ai/code/session_0133zgX2g8oLCoH4KuY8tM9b