Type Alias MainnetContext

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

Source

pub fn with_new_journal<OJOURNAL>( self, journal: OJOURNAL, ) -> Context<BLOCK, TX, CFG, DB, OJOURNAL, CHAIN>
where OJOURNAL: JournalTr<Database = DB>,

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Creates a new context with a new chain type.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn modify_block<F>(&mut self, f: F)
where F: FnOnce(&mut BLOCK),

Modifies the context block.

Source

pub fn modify_tx<F>(&mut self, f: F)
where F: FnOnce(&mut TX),

Source

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

Source

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

Source

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

Source

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

Source§

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,

Source

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

Trait Implementations

Source§

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

Source§

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

Returns a copy 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<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§

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

Source§

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

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

Source§

type Block = BLOCK

Block type
Source§

type Tx = TX

Transaction type
Source§

type Cfg = CFG

Configuration type
Source§

type Db = DB

Database type
Source§

type Journal = JOURNAL

Journal type
Source§

type Chain = CHAIN

Chain type
Source§

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

Get the block
Source§

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

Get the journal
Source§

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

Get the database
Source§

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

Get the chain
Source§

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)

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

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

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

Source§

fn build_mainnet(self) -> MainnetEvm<Self::Context>

Source§

fn build_mainnet_with_inspector<INSP>( self, inspector: INSP, ) -> MainnetEvm<Self::Context, INSP>

Source§

impl MainContext for Context<BlockEnv, TxEnv, CfgEnv, EmptyDB, Journal<EmptyDB>, ()>

Source§

fn mainnet() -> Self