-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix(api): Replace enum with string type for EvmError (#811)
## Description _Concise description of proposed changes_ ## Testing Explain the quality checks that have been done on the code changes ## Additional Information - [ ] I read the [contributing docs](../docs/contributing.md) (if this is your first contribution) Your ENS/address: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated the API documentation to reflect the correct line numbers for various entities. - **New Features** - Enhanced the error message system to include a broader range of EVM-related errors. - **Bug Fixes** - Fixed a bug in the "@tevm/api" package to correctly handle EVM error types without the need for external imports. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Will Cory <[email protected]>
- Loading branch information
1 parent
8b3218b
commit 87427f3
Showing
8 changed files
with
62 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tevm/api": patch | ||
--- | ||
|
||
Fixed bug with EVM errors requiring importing ethereumjs enum to typematch |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
import type { TypedError } from './TypedError.js' | ||
import { EVMErrorMessage } from '@ethereumjs/evm' | ||
|
||
export type TevmEVMErrorMessage = | ||
| 'out of gas' | ||
| 'code store out of gas' | ||
| 'code size to deposit exceeds maximum code size' | ||
| 'stack underflow' | ||
| 'stack overflow' | ||
| 'invalid JUMP' | ||
| 'invalid opcode' | ||
| 'value out of range' | ||
| 'revert' | ||
| 'static state change' | ||
| 'internal error' | ||
| 'create collision' | ||
| 'stop' | ||
| 'refund exhausted' | ||
| 'value overflow' | ||
| 'insufficient balance' | ||
| 'invalid BEGINSUB' | ||
| 'invalid RETURNSUB' | ||
| 'invalid JUMPSUB' | ||
| 'invalid bytecode deployed' | ||
| 'invalid EOF format' | ||
| 'initcode exceeds max initcode size' | ||
| 'invalid input length' | ||
| 'attempting to AUTHCALL without AUTH set' | ||
| 'attempting to execute AUTHCALL with nonzero external value' | ||
| 'invalid Signature: s-values greater than secp256k1n/2 are considered invalid' | ||
|
||
// BLS errors | ||
| 'invalid input length' | ||
| 'point not on curve' | ||
| 'input is empty' | ||
| 'fp point not in field' | ||
|
||
// Point Evaluation Errors | ||
| 'kzg commitment does not match versioned hash' | ||
| 'kzg inputs invalid' | ||
| 'kzg proof invalid' | ||
|
||
/** | ||
* Error type of errors thrown while internally executing a call in the EVM | ||
*/ | ||
export type EvmError< | ||
TEVMErrorMessage extends EVMErrorMessage = EVMErrorMessage, | ||
TEVMErrorMessage extends TevmEVMErrorMessage = TevmEVMErrorMessage, | ||
> = TypedError<TEVMErrorMessage> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,4 @@ | |
"publishConfig": { | ||
"access": "public" | ||
} | ||
} | ||
} |
87427f3
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.
Successfully deployed to the following URLs:
evmts-docs – ./
evmts-docs-git-main-evmts.vercel.app
evmts.dev
evmts-docs-evmts.vercel.app