Repository navigation
fix(0.x): port recent viem fixes to Bytes, Hex, Siwe, TypedData, AbiItem, AbiEvent and RpcTransport - #601
Merged
Conversation
…ytes Ports wevm/viem#5444. An odd-length value now gets its leading 0 before it is right-padded to size, so 0x1 with size 2 decodes to [1, 0] instead of [16, 0]. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
…Message Ports wevm/viem#5440. EIP-4361 requires an alphanumeric nonce of at least 8 characters and version 1. Absent fields are still skipped. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports wevm/viem#5403. Payloads such as HyperliquidTransaction:SendAsset failed TypedData.assert. The encoded type and hash are unchanged. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports wevm/viem#5384. Dynamic bytes now matches only hex strings and Uint8Array values, so a plain string selects the string overload instead of throwing AbiItem.AmbiguityError. Hex strings still throw when both overloads match. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports wevm/viem#5428. Integer arguments compare by value, so a number matches a decoded bigint and a bigint matches a small integer decoded as a number. A non-integer number still mismatches. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
Ports wevm/viem#5404. Default and caller headers are merged through Headers into a plain object, so a caller's Content-Type replaces the default whatever its casing, and Headers instances and tuple arrays keep their entries. Amp-Thread-ID: https://ampcode.com/threads/T-01a1bcb4-18f0-70ab-84d3-47f6d9755544 Co-authored-by: Amp <[email protected]> Co-authored-by: jxom <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
|
Published pnpm add ox@pr-601
pnpm add [email protected] |
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.xcounterpart of #600. It ports wevm/viem#5444, wevm/viem#5440, wevm/viem#5403, wevm/viem#5384, wevm/viem#5428 and wevm/viem#5404. One commit per fix.Bytes.fromHex/Hex.toBytes(fix: preserve odd-length hex bytes in sized hexToBytes viem#5444): withsize, an odd-length value's extra nibble no longer lands at the end.0x1with size 2 returns[1, 0]instead of[16, 0].0.xhad the same code as viem, so this is the same change.Siwe.validateMessage(fix(siwe): reject a short nonce and a version other than 1 in validateSiweMessage viem#5440): returnsfalsefor a nonce shorter than 8 alphanumeric characters or a version other than1.TypedData(fix(typedData): accept struct names that contain:viem#5403): accepts struct names that contain:, such asHyperliquidTransaction:SendAsset.AbiItem.fromAbi(fix: resolve string overloads when the argument is not bytes viem#5384): a plain string no longer matches dynamicbytes, sostring/bytesoverloads resolve tostringinstead of throwingAbiItem.AmbiguityError.AbiEvent.assertArgs(fix: match number and bigint integer filters in parseEventLogs viem#5428): integer arguments compare by value acrossnumberandbigint.RpcTransport.fromHttp(fix: preservehttpheaders supplied asHeadersor tuples viem#5404):fetchOptions.headersgiven as aHeadersinstance or tuple array were spread as an object and dropped. Headers are now merged throughHeaders, which also stops a differently casedContent-Typefrom being sent next to the default.Differences from #600:
0.xhas noAbiEvent.extractLogs, so onlyassertArgschanges there.Validation:
pnpm check:typesand Biome on the changed files pass. Every new test fails without its fix, and the new inline snapshots matchmain's. Thecoreandtempo-unitprojects pass with the Anvil global setup disabled, except tests that need a local Anvil node.