-
Notifications
You must be signed in to change notification settings - Fork 202
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
feat(eth): unit tests for types, crypto, encoding #1838
Conversation
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the 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 (
|
* feat(eth): protos, eth types, and evm module types * chore: changelog * feat(eth): unit tests for types, crypto, encoding (#1838) * feat(eth): unit tests for types, crypto, encoding ## Impl `go-ethereum` Adds `go-ethereum` fork with an `Interpreter` interface for running smart contracts in integration tests. ```go type Interpreter interface { // Run loops and evaluates the contract's code with the given input data and returns // the return byte-slice and an error if one occurred. Run(contract *Contract, input []byte, static bool) ([]byte, error) } ``` An `Interpreter` is used to run Ethereum based contracts and will utilize the passed environment to query external sources for state information. The Interpreter will run the byte code VM based on the passed configuration. Changes from go-ethereum v1.11: * Set `callcode` to use `readOnly` mode for precompiled calls. * Remove `IsStateful` function from the `PrecompiledContract` interface, as this remains unused. * Support stateful precompiled contracts. * Add `Address` function to `PrecompiledContract` interface. * Implement custom active precompiles for the EVM. * Define `Interpreter` interface for the EVM. * Move the `JumpTable` defaults to a separate function. * Refactor `Stack` implementation * chore: linter * docs(sample.go): PrivKeyEth * refactor: fix copyright lines and LICENSE entity * feat(eth): Collections encoders for bytes, Ethereum addresses, and Ethereum hashes (#1841)
Purpose / Abstract
Impl
go-ethereum
Adds
go-ethereum
fork with anInterpreter
interface for running smartcontracts in integration tests.
An
Interpreter
is used to run Ethereum based contracts and will utilize thepassed environment to query external sources for state information.
The Interpreter will run the byte code VM based on the passed
configuration.
Changes from go-ethereum v1.11:
callcode
to usereadOnly
mode for precompiled calls.IsStateful
function from thePrecompiledContract
interface, as this remains unused.Address
function toPrecompiledContract
interface.Interpreter
interface for the EVM.JumpTable
defaults to a separate function.Stack
implementation