Trait ContextTr
pub trait ContextTr {
type Block: Block;
type Tx: Transaction;
type Cfg: Cfg;
type Db: Database;
type Journal: JournalTr<Database = Self::Db>;
type Chain;
// Required methods
fn tx(&self) -> &Self::Tx;
fn block(&self) -> &Self::Block;
fn cfg(&self) -> &Self::Cfg;
fn journal(&mut self) -> &mut Self::Journal;
fn journal_ref(&self) -> &Self::Journal;
fn db(&mut self) -> &mut Self::Db;
fn db_ref(&self) -> &Self::Db;
fn chain(&mut self) -> &mut Self::Chain;
fn error(
&mut self,
) -> &mut Result<(), ContextError<<Self::Db as Database>::Error>>;
fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal);
}
Expand description
Trait that defines the context of the EVM execution.
This trait is used to access the environment and state of the EVM. It is used to access the transaction, block, configuration, database, journal, and chain. It is also used to set the error of the EVM.
Required Associated Types§
type Tx: Transaction
type Tx: Transaction
Transaction type
type Chain
type Chain
Chain type
Required Methods§
fn journal_ref(&self) -> &Self::Journal
fn journal_ref(&self) -> &Self::Journal
Get the journal reference
fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal)
fn tx_journal(&mut self) -> (&mut Self::Tx, &mut Self::Journal)
Get the transaction and journal. It is used to efficiently load access list into journal without copying them from transaction.