From 9aac37e434bb6fbe0eae5f6926af575600407316 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 9 Feb 2024 23:25:05 +0100 Subject: [PATCH] fix: properly set context env --- crates/revm/src/builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/revm/src/builder.rs b/crates/revm/src/builder.rs index 36a20cb261..6f29a7f4d3 100644 --- a/crates/revm/src/builder.rs +++ b/crates/revm/src/builder.rs @@ -101,14 +101,14 @@ impl<'a, EXT, DB: Database> EvmBuilder<'a, SetGenericStage, EXT, DB> { /// Sets Builder with [`EnvWithHandlerCfg`]. pub fn with_env_with_handler_cfg( - self, + mut self, env_with_handler_cfg: EnvWithHandlerCfg, ) -> EvmBuilder<'a, HandlerStage, EXT, DB> { + let EnvWithHandlerCfg { env, handler_cfg } = env_with_handler_cfg; + self.context.evm.env = env; EvmBuilder { context: self.context, - handler: EvmBuilder::<'a, HandlerStage, EXT, DB>::handler( - env_with_handler_cfg.handler_cfg, - ), + handler: EvmBuilder::<'a, HandlerStage, EXT, DB>::handler(handler_cfg), phantom: PhantomData, } }