Struct revm::EVM [−][src]
Expand description
Struct that takes Database and enabled transact to update state dirrectly to database. additionaly it allows user to set all environment parameters.
Parameters that can be set are devided between Config, Block and Transaction(tx)
For transacting on EVM you can call transact_commit that will automatically apply changes to db.
You can do a lot with rust and traits. For Database abstractions that we need you can implement, Database, DatabaseRef or Database+DatabaseCommit and they enable functionality depending on what kind of handling of struct you want.
- Database trait has mutable self in its functions. It is usefull if on get calls you want to modify
your cache or update some statistics. They enable
transact
andinspect
functions - DatabaseRef takes reference on object, this is useful if you only have reference on state and dont
want to update anything on it. It enabled
transact_ref
andinspect_ref
functions - Database+DatabaseCommit allow’s dirrectly commiting changes of transaction. it enabled
transact_commit
andinspect_commit
Fields
env: Env
db: Option<DB>
Implementations
Execute transaction and apply result to database
pub fn inspect_commit<INSP: Inspector>(
&mut self,
inspector: INSP
) -> (Return, TransactOut, u64)
pub fn inspect_commit<INSP: Inspector>(
&mut self,
inspector: INSP
) -> (Return, TransactOut, u64)
Inspect transaction and commit changes to database.
Execute transaction without writing to DB, return change state.
Execute transaction without writing to DB, return change state.