-
Notifications
You must be signed in to change notification settings - Fork 589
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: add with_handler method to EvmBuilder #1124
Conversation
eef91b4
to
98dbc7e
Compare
crates/revm/src/builder.rs
Outdated
/// // set up empty handler cfg | ||
/// let handler = HandlerCfg::new(SpecId::LATEST); | ||
/// let builder = builder.with_handler_cfg(handler); |
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.
Would remove this lines, they can be confusing
/// // set up empty handler cfg | |
/// let handler = HandlerCfg::new(SpecId::LATEST); | |
/// let builder = builder.with_handler_cfg(handler); |
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.
Second comment will address why you needed this previously: #1124 (comment)
crates/revm/src/builder.rs
Outdated
/// // build the EVM | ||
/// let evm = builder.build(); | ||
/// ``` | ||
pub fn with_handler( |
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.
This function is inside:
impl<'a, EXT, DB: Database> EvmBuilder<'a, HandlerStage, EXT, DB> {
But it should be in:
impl<'a, BuilderStage, EXT, DB: Database> EvmBuilder<'a, BuilderStage, EXT, DB> {
Reason for this is that with_handler
can be called from both HandlerStage
and SetGenericStage
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.
ah I see, yeah it makes sense to call it from either handler or setgeneric stages
* feat: add with_handler method to EvmBuilder * improve docs * add imports to docs * fix docs * move with_handler to BuilderStage
Added a method to make it possible to add a specific handler, for example a handler other than optimism or mainnet, to the evm builder.