Skip to content

Commit bc77b08

Browse files
authored
Add db and db_mut to evm (#1133)
* Add `db` and `db_mut` to evm * Fix format
1 parent a0e45a5 commit bc77b08

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/revm/src/evm.rs

+12
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ impl<EXT, DB: Database> Evm<'_, EXT, DB> {
141141
&mut self.context.evm.env.tx
142142
}
143143

144+
/// Returns the reference of database
145+
#[inline]
146+
pub fn db(&self) -> &DB {
147+
&self.context.evm.db
148+
}
149+
150+
/// Returns the mutable reference of database
151+
#[inline]
152+
pub fn db_mut(&mut self) -> &mut DB {
153+
&mut self.context.evm.db
154+
}
155+
144156
/// Returns the reference of block
145157
#[inline]
146158
pub fn block(&self) -> &BlockEnv {

0 commit comments

Comments
 (0)