From bcdc652cac5940ed8b3521519d590b9371660521 Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:21:59 +0200 Subject: [PATCH] Implement `with_chain_id` for `CfgEnv` (#1327) * Implement with_chain_id for CfgEnv * cargo fmt * fix comments --- crates/primitives/src/env.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/primitives/src/env.rs b/crates/primitives/src/env.rs index 9a4470a912..9d0bc100a1 100644 --- a/crates/primitives/src/env.rs +++ b/crates/primitives/src/env.rs @@ -338,6 +338,11 @@ pub struct CfgEnv { } impl CfgEnv { + pub fn with_chain_id(mut self, chain_id: u64) -> Self { + self.chain_id = chain_id; + self + } + #[cfg(feature = "optional_eip3607")] pub fn is_eip3607_disabled(&self) -> bool { self.disable_eip3607