Type Alias MainnetContext

pub type MainnetContext<DB> = Context<BlockEnv, TxEnv, CfgEnv, DB>;

Aliased Type§

pub struct MainnetContext<DB> {
    pub block: BlockEnv,
    pub tx: TxEnv,
    pub cfg: CfgEnv,
    pub journaled_state: Journal<DB>,
    pub chain: (),
    pub local: LocalContext,
    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.

§local: LocalContext

Local context that is filled by execution.

§error: Result<(), ContextError<<DB as Database>::Error>>

Error that happened during execution.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.

Implementations

§

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>,

Creates a new context with a new journal type. New journal needs to have the same database type.

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.

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.

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.

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.

pub fn with_chain<OC>( self, chain: OC, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, OC>

Creates a new context with a new chain type.

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.

pub fn modify_cfg_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
where F: FnOnce(&mut CFG),

Modifies the context configuration.

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.

pub fn modify_tx_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
where F: FnOnce(&mut TX),

Modifies the context transaction.

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.

pub fn modify_db_chained<F>( self, f: F, ) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
where F: FnOnce(&mut DB),

Modifies the context database.

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.

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)
where F: FnOnce(&mut TX),

Modifies the context transaction.

pub fn modify_cfg<F>(&mut self, f: F)
where F: FnOnce(&mut CFG),

Modifies the context configuration.

pub fn modify_chain<F>(&mut self, f: F)
where F: FnOnce(&mut CHAIN),

Modifies the context chain.

pub fn modify_db<F>(&mut self, f: F)
where F: FnOnce(&mut DB),

Modifies the context database.

pub fn modify_journal<F>(&mut self, f: F)
where F: FnOnce(&mut JOURNAL),

Modifies the context journal.

§

impl<BLOCK, TX, DB, JOURNAL, CHAIN> Context<BLOCK, TX, CfgEnv, DB, JOURNAL, CHAIN>
where BLOCK: Block + Default, TX: Transaction + Default, DB: Database, JOURNAL: JournalTr<Database = DB>, CHAIN: Default,

pub fn new( db: DB, spec: SpecId, ) -> Context<BLOCK, TX, CfgEnv, DB, JOURNAL, CHAIN>

Creates a new context with a new database type.

This will create a new Journal object.

Trait Implementations

Source§

impl<DB, J, C> AsEnvMut for Context<BlockEnv, TxEnv, CfgEnv, DB, J, C>
where DB: Database, J: JournalTr<Database = DB>,

Source§

fn as_env_mut(&mut self) -> EnvMut<'_>

§

impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> Clone for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL>
where DB: Database + Clone, JOURNAL: JournalTr<Database = DB> + Clone, LOCAL: LocalContextTr + Clone, BLOCK: Clone, CFG: Clone, CHAIN: Clone, TX: Clone, <DB as Database>::Error: Clone,

§

fn clone(&self) -> Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<DB, C> ContextExt for Context<BlockEnv, TxEnv, CfgEnv, DB, Journal<DB>, C>
where DB: Database,

Source§

type DB = DB

Source§

fn as_db_env_and_journal( &mut self, ) -> (&mut <Context<BlockEnv, TxEnv, CfgEnv, DB, Journal<DB>, C> as ContextExt>::DB, &mut JournalInner<JournalEntry>, EnvMut<'_>)

§

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>,

§

fn set_tx( &mut self, tx: <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Tx, )

§

fn set_block( &mut self, block: <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as ContextTr>::Block, )

§

impl<BLOCK, TX, DB, CFG, JOURNAL, CHAIN, LOCAL> ContextTr for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL>
where BLOCK: Block, TX: Transaction, DB: Database, CFG: Cfg, JOURNAL: JournalTr<Database = DB>, LOCAL: LocalContextTr,

§

type Block = BLOCK

Block type
§

type Tx = TX

Transaction type
§

type Cfg = CFG

Configuration type
§

type Db = DB

Database type
§

type Journal = JOURNAL

Journal type
§

type Chain = CHAIN

Chain type
§

type Local = LOCAL

Local context type
§

fn tx( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Tx

Get the transaction
§

fn block( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Block

Get the block
§

fn cfg( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Cfg

Get the configuration
§

fn journal( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Journal

Get the journal
§

fn journal_ref( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Journal

Get the journal reference
§

fn db( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Db

Get the database
§

fn db_ref( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Db

Get the database reference
§

fn chain( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Chain

Get the chain
§

fn chain_ref( &self, ) -> &<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Chain

Get the chain reference
§

fn local( &mut self, ) -> &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Local

Get the local context
§

fn error( &mut self, ) -> &mut Result<(), ContextError<<<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Db as Database>::Error>>

Get the error
§

fn tx_journal( &mut self, ) -> (&<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Tx, &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Journal)

Get the transaction and journal. It is used to efficiently load access list into journal without copying them from transaction.
§

fn tx_local( &mut self, ) -> (&<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Tx, &mut <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> as ContextTr>::Local)

Get the transaction and local context. It is used to efficiently load initcode into local context without copying them from transaction.
§

impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL> Debug for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN, LOCAL>
where DB: Database + Debug, JOURNAL: JournalTr<Database = DB> + Debug, LOCAL: LocalContextTr + Debug, BLOCK: Debug, CFG: Debug, CHAIN: Debug, TX: Debug, <DB as Database>::Error: Debug,

§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> MainBuilder for Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>
where BLOCK: Block, TX: Transaction, CFG: Cfg, DB: Database, JOURNAL: JournalTr<Database = DB>,

§

type Context = Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN>

§

fn build_mainnet( self, ) -> Evm<<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as MainBuilder>::Context, (), EthInstructions<EthInterpreter, <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as MainBuilder>::Context>, EthPrecompiles>

§

fn build_mainnet_with_inspector<INSP>( self, inspector: INSP, ) -> Evm<<Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as MainBuilder>::Context, INSP, EthInstructions<EthInterpreter, <Context<BLOCK, TX, CFG, DB, JOURNAL, CHAIN> as MainBuilder>::Context>, EthPrecompiles>

§

impl MainContext for Context