diff --git a/Cargo.toml b/Cargo.toml index 8cbf0ed..8599a6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trevm" -version = "0.30.1" +version = "0.31.0" rust-version = "1.83.0" edition = "2021" authors = ["init4"] @@ -44,8 +44,8 @@ alloy = { version = "1.0.35", default-features = false, features = [ "sol-types", ] } -revm = { version = "30.1.2", default-features = false } -revm-inspectors = { version = "0.31", optional = true } +revm = { version = "31", default-features = false } +revm-inspectors = { version = "0.32", optional = true } dashmap = { version = "6.1.0", optional = true } tracing = { version = "0.1.41", optional = true } @@ -54,7 +54,7 @@ thiserror = "2.0.11" tokio = { version = "1.44", optional = true } [dev-dependencies] -revm = { version = "30.1.1", features = ["serde-json", "std", "alloydb"] } +revm = { version = "31", features = ["serde-json", "std", "alloydb"] } trevm = { path = ".", features = ["test-utils"] } alloy = { version = "1.0.35", features = ["providers", "transports"] } diff --git a/src/evm/has_cfg.rs b/src/evm/has_cfg.rs index 99e0e03..6232582 100644 --- a/src/evm/has_cfg.rs +++ b/src/evm/has_cfg.rs @@ -7,6 +7,16 @@ where Insp: Inspector>, TrevmState: HasCfg, { + /// Get a reference to the current EVM configuration. + pub fn cfg(&self) -> &revm::context::CfgEnv { + self.inner.ctx.cfg() + } + + /// Get the current chain ID. + pub fn chain_id(&self) -> u64 { + self.cfg().chain_id + } + /// Set the [EIP-170] contract code size limit. By default this is set to /// 0x6000 bytes (~25KiB). Contracts whose bytecode is larger than this /// limit cannot be deployed and will produce a [`CreateInitCodeSizeLimit`]