pub type MainnetContext<DB> = Context<BlockEnv, TxEnv, CfgEnv, DB, Journal<DB>, ()>;
Aliased Type§
struct MainnetContext<DB> {
pub block: BlockEnv,
pub tx: TxEnv,
pub cfg: CfgEnv,
pub journaled_state: Journal<DB>,
pub chain: (),
pub error: Result<(), ContextError<<DB as Database>::Error>>,
}
Fields§
§block: BlockEnv
Block information.
tx: TxEnv
Transaction information.
cfg: CfgEnv
Configurations.
journaled_state: Journal<DB>
EVM State with journaling support and database.
chain: ()
Inner context.
error: Result<(), ContextError<<DB as Database>::Error>>
Error that happened during execution.
Implementations
Source§impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
CFG: Cfg,
DB: Database,
JOURNAL: JournalTr<Database = DB>,
impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
CFG: Cfg,
DB: Database,
JOURNAL: JournalTr<Database = DB>,
pub fn with_new_journal<OJOURNAL>(
self,
journal: OJOURNAL,
) -> Context<BLOCK, TX, CFG, DB, OJOURNAL, CHAIN>where
OJOURNAL: JournalTr<Database = DB>,
Sourcepub fn with_db<ODB>(
self,
db: ODB,
) -> Context<BLOCK, TX, CFG, ODB, Journal<ODB>, CHAIN>where
ODB: Database,
pub fn with_db<ODB>(
self,
db: ODB,
) -> Context<BLOCK, TX, CFG, ODB, Journal<ODB>, CHAIN>where
ODB: Database,
Creates a new context with a new database type.
This will create a new Journal
object.
Sourcepub fn with_ref_db<ODB>(
self,
db: ODB,
) -> Context<BLOCK, TX, CFG, WrapDatabaseRef<ODB>, Journal<WrapDatabaseRef<ODB>>, CHAIN>where
ODB: DatabaseRef,
pub fn with_ref_db<ODB>(
self,
db: ODB,
) -> Context<BLOCK, TX, CFG, WrapDatabaseRef<ODB>, Journal<WrapDatabaseRef<ODB>>, CHAIN>where
ODB: DatabaseRef,
Creates a new context with a new DatabaseRef
type.
Sourcepub fn with_block<OB>(
self,
block: OB,
) -> Context<OB, TX, CFG, DB, JOURNAL, CHAIN>where
OB: Block,
pub fn with_block<OB>(
self,
block: OB,
) -> Context<OB, TX, CFG, DB, JOURNAL, CHAIN>where
OB: Block,
Creates a new context with a new block type.
Sourcepub fn with_tx<OTX>(
self,
tx: OTX,
) -> Context<BLOCK, OTX, CFG, DB, JOURNAL, CHAIN>where
OTX: Transaction,
pub fn with_tx<OTX>(
self,
tx: OTX,
) -> Context<BLOCK, OTX, CFG, DB, JOURNAL, CHAIN>where
OTX: Transaction,
Creates a new context with a new transaction type.
Sourcepub fn with_chain<OC>(
self,
chain: OC,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, OC>
pub fn with_chain<OC>( self, chain: OC, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, OC>
Creates a new context with a new chain type.
Sourcepub fn with_cfg<OCFG>(
self,
cfg: OCFG,
) -> Context<BLOCK, TX, OCFG, DB, JOURNAL, CHAIN>where
OCFG: Cfg,
pub fn with_cfg<OCFG>(
self,
cfg: OCFG,
) -> Context<BLOCK, TX, OCFG, DB, JOURNAL, CHAIN>where
OCFG: Cfg,
Creates a new context with a new chain type.
Sourcepub fn modify_cfg_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
pub fn modify_cfg_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
Modifies the context configuration.
Sourcepub fn modify_block_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut BLOCK),
pub fn modify_block_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut BLOCK),
Modifies the context block.
Sourcepub fn modify_tx_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
pub fn modify_tx_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
Modifies the context transaction.
Sourcepub fn modify_chain_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut CHAIN),
pub fn modify_chain_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut CHAIN),
Modifies the context chain.
Sourcepub fn modify_db_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
pub fn modify_db_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
Modifies the context database.
Sourcepub fn modify_journal_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut JOURNAL),
pub fn modify_journal_chained<F>(
self,
f: F,
) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
F: FnOnce(&mut JOURNAL),
Modifies the context journal.
Sourcepub fn modify_block<F>(&mut self, f: F)where
F: FnOnce(&mut BLOCK),
pub fn modify_block<F>(&mut self, f: F)where
F: FnOnce(&mut BLOCK),
Modifies the context block.
pub fn modify_tx<F>(&mut self, f: F)
pub fn modify_cfg<F>(&mut self, f: F)
pub fn modify_chain<F>(&mut self, f: F)where
F: FnOnce(&mut CHAIN),
pub fn modify_db<F>(&mut self, f: F)
pub fn modify_journal<F>(&mut self, f: F)where
F: FnOnce(&mut JOURNAL),
Trait Implementations
Source§impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> Clone for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> Clone for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
Source§impl<BLOCK, TX, DB, CFG, JOURNAL, CHAIN> ContextSetters for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
DB: Database,
CFG: Cfg,
JOURNAL: JournalTr<Database = DB>,
impl<BLOCK, TX, DB, CFG, JOURNAL, CHAIN> ContextSetters for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
DB: Database,
CFG: Cfg,
JOURNAL: JournalTr<Database = DB>,
Source§impl<BLOCK, TX, DB, CFG, JOURNAL, CHAIN> ContextTr for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
DB: Database,
CFG: Cfg,
JOURNAL: JournalTr<Database = DB>,
impl<BLOCK, TX, DB, CFG, JOURNAL, CHAIN> ContextTr for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>where
BLOCK: Block,
TX: Transaction,
DB: Database,
CFG: Cfg,
JOURNAL: JournalTr<Database = DB>,
Source§fn tx(&self) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Tx
fn tx(&self) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Tx
Get the transaction
Source§fn block(
&self,
) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Block
fn block( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Block
Get the block
Source§fn cfg(
&self,
) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Cfg
fn cfg( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Cfg
Get the configuration
Source§fn journal(
&mut self,
) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal
fn journal( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal
Get the journal
Source§fn journal_ref(
&self,
) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal
fn journal_ref( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal
Get the journal reference
Source§fn db(
&mut self,
) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db
fn db( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db
Get the database
Source§fn db_ref(
&self,
) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db
fn db_ref( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db
Get the database reference
Source§fn chain(
&mut self,
) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Chain
fn chain( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Chain
Get the chain
Source§fn error(
&mut self,
) -> &mut Result<(), ContextError<<<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db as Database>::Error>>
fn error( &mut self, ) -> &mut Result<(), ContextError<<<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Db as Database>::Error>>
Get the error
Source§fn tx_journal(
&mut self,
) -> (&mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Tx, &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal)
fn tx_journal( &mut self, ) -> (&mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Tx, &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Journal)
Get the transaction and journal. It is used to efficiently load access list
into journal without copying them from transaction.