-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Fix(zod): Fixed bug with property errors being swallowed #807
🐛 Fix(zod): Fixed bug with property errors being swallowed #807
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: d43355e The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe recent patch addresses a critical issue in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
c2520d2
to
5692585
Compare
d9c125d
to
8b582a2
Compare
8b582a2
to
d43355e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .changeset/afraid-crabs-exist.md (1 hunks)
- vm/zod/src/validators/validateContractParams.js (1 hunks)
Additional comments: 3
.changeset/afraid-crabs-exist.md (2)
1-3: The changeset metadata correctly specifies the package and the type of change as a patch.
5-5: The description clearly explains the bug fix related to the
to
parameter in the zod validator.vm/zod/src/validators/validateContractParams.js (1)
- 43-47: The added conditional check for
formattedErrors.to
correctly captures and reports errors related to theto
parameter. Ensure that thecreateError
function is robust and handles all possible error inputs correctly.Verification successful
The
createError
function is implemented to construct an error object with a flexible structure that can handle various error inputs, including the case in the PR where it is used to reportInvalidAddressError
. The function is robust and aligns with the usage seen across the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that createError function handles all possible error inputs correctly. rg --type js 'function createError' -- 'src/common/index.js'Length of output: 120
Script:
#!/bin/bash # Search for the createError function definition in the JavaScript files without assuming its location. rg --type js 'function createError'Length of output: 37
Script:
#!/bin/bash # Search for any occurrence of the createError function or method in the entire codebase. rg 'createError'Length of output: 4388
Script:
#!/bin/bash # Retrieve the full implementation of the createError function to verify its robustness. cat vm/zod/src/common/createError.jsLength of output: 299
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @tevm/[email protected] ### Major Changes - [#828](#828) [`3b5f6729`](3b5f672) Thanks [@roninjin10](https://github.com/roninjin10)! - - Changed name of `TevmContract` to `Contract` - Changed name of `createTevmContract` to `createContract` - Added `Script` to be a Contract with bytecode - Removed bytecode from `Contract` - Added a new `withAddress` method for adding an address to a contract - Removed need to explicitly pass in undefined for optional params ## withAddress Before we had to spred contracts like this: ```typescript client.readContract({ address: contractAddress, ...Erc20Contract.read.balanceOf(userAddress), }); ``` Now Tevm can create a contract with an address attatched ```typescript client.readContract( Erc20Contract.withAddress(contractAddress).read.balanceOf(userAddress) ); ``` ## @tevm/[email protected] ### Minor Changes - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods such as chainId getCode and getStorageAt to Tevm.eth. ### Patch Changes - [#804](#804) [`d514d111`](d514d11) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with viem extension not decoding rawData into data - Updated dependencies \[[`8b3218b1`](8b3218b), [`39a5b5e5`](39a5b5e), [`98d76506`](98d7650)]: - @tevm/[email protected] ## [email protected] ### Minor Changes - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods such as chainId getCode and getStorageAt to Tevm.eth. ### Patch Changes - [#804](#804) [`d514d111`](d514d11) Thanks [@roninjin10](https://github.com/roninjin10)! - Update tevm package to export all of tevm. Now users only need to `npm install tevm` to use all of tevm - Updated dependencies \[[`87427f30`](87427f3), [`8b3218b1`](8b3218b), [`cae17b7d`](cae17b7), [`39a5b5e5`](39a5b5e), [`3b5f6729`](3b5f672), [`0ee22d0a`](0ee22d0), [`0ee22d0a`](0ee22d0), [`d514d111`](d514d11), [`941a630a`](941a630), [`98d76506`](98d7650)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Minor Changes - [#820](#820) [`cae17b7d`](cae17b7) Thanks [@roninjin10](https://github.com/roninjin10)! - Added all eth_\* debug_\_ and anvil\_\_ JSON-rpc methods and handlers to API. - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods such as chainId getCode and getStorageAt to Tevm.eth. ### Patch Changes - [#811](#811) [`87427f30`](87427f3) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with EVM errors requiring importing ethereumjs enum to typematch - [#800](#800) [`0ee22d0a`](0ee22d0) Thanks [@roninjin10](https://github.com/roninjin10)! - Renamed TevmClient type to Tevm - [#800](#800) [`0ee22d0a`](0ee22d0) Thanks [@roninjin10](https://github.com/roninjin10)! - Added JSDOC to @tevm/api - [#808](#808) [`941a630a`](941a630) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with 'to' and 'error' properties not quite working correctly for tevm. To was listed as require instead of only existing when no errors. ## @tevm/[email protected] ### Minor Changes - [#805](#805) [`8b3218b1`](8b3218b) Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load and Dump actions - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods such as chainId getCode and getStorageAt to Tevm.eth. - [#823](#823) [`f7865314`](f786531) Thanks [@roninjin10](https://github.com/roninjin10)! - Added support for debug_traceCall handler ### Patch Changes - [#804](#804) [`d514d111`](d514d11) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with tevm account not updating code hash when deployedBytecode is put into state - Updated dependencies \[[`3b4a347d`](3b4a347), [`39a5b5e5`](39a5b5e), [`d514d111`](d514d11), [`d514d111`](d514d11), [`aec294ba`](aec294b)]: - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Minor Changes - [#805](#805) [`8b3218b1`](8b3218b) Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load and Dump actions ## @tevm/[email protected] ### Minor Changes - [#805](#805) [`8b3218b1`](8b3218b) Thanks [@0xNonCents](https://github.com/0xNonCents)! - Enable State Load and Dump actions - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Added eth methods such as chainId getCode and getStorageAt to Tevm.eth. - [#818](#818) [`98d76506`](98d7650) Thanks [@roninjin10](https://github.com/roninjin10)! - Added blockchain to the Tevm VM so anvil, hardhat, and eth_json_rpc requests can be handled ### Patch Changes - Updated dependencies \[[`87427f30`](87427f3), [`d514d111`](d514d11), [`39a5b5e5`](39a5b5e), [`8b3218b1`](8b3218b), [`d514d111`](d514d11), [`cae17b7d`](cae17b7), [`39a5b5e5`](39a5b5e), [`3b5f6729`](3b5f672), [`0ee22d0a`](0ee22d0), [`0ee22d0a`](0ee22d0), [`941a630a`](941a630), [`f7865314`](f786531)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`3b5f6729`](3b5f672)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#822](#822) [`39a5b5e5`](39a5b5e) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with swallowing errors that didn't return text - [#804](#804) [`d514d111`](d514d11) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with checking method falsely ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`8b3218b1`](8b3218b), [`39a5b5e5`](39a5b5e), [`3b5f6729`](3b5f672), [`d514d111`](d514d11), [`98d76506`](98d7650)]: - @tevm/[email protected] - @tevm/[email protected] - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - Updated dependencies \[[`3b5f6729`](3b5f672)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#809](#809) [`0efe3b03`](0efe3b0) Thanks [@roninjin10](https://github.com/roninjin10)! - Added jsdoc to createHttpHandler - Updated dependencies \[[`3b4a347d`](3b4a347), [`d514d111`](d514d11), [`aec294ba`](aec294b)]: - @tevm/[email protected] ## @tevm/[email protected] ### Patch Changes - [#807](#807) [`3b4a347d`](3b4a347) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with zod validator swallowing missing `to` parameter errors - [#804](#804) [`d514d111`](d514d11) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug with JsonRpcRequest throwing for requests with no params - [#806](#806) [`aec294ba`](aec294b) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug in zod validators for contract params which falsely listed `to` as optional - Updated dependencies \[[`87427f30`](87427f3), [`cae17b7d`](cae17b7), [`39a5b5e5`](39a5b5e), [`0ee22d0a`](0ee22d0), [`0ee22d0a`](0ee22d0), [`941a630a`](941a630)]: - @tevm/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Concise description of proposed changes
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit
to
parameters were not being reported correctly.