pub trait StorageOverride<Block>: Send + Syncwhere
    Block: Block,{
    // Required methods
    fn account_code_at(
        &self,
        block_hash: <Block as Block>::Hash,
        address: H160
    ) -> Option<Vec<u8, Global>>;
    fn storage_at(
        &self,
        block_hash: <Block as Block>::Hash,
        address: H160,
        index: U256
    ) -> Option<H256>;
    fn current_block(
        &self,
        block_hash: <Block as Block>::Hash
    ) -> Option<Block<TransactionV2>>;
    fn current_receipts(
        &self,
        block_hash: <Block as Block>::Hash
    ) -> Option<Vec<ReceiptV3, Global>>;
    fn current_transaction_statuses(
        &self,
        block_hash: <Block as Block>::Hash
    ) -> Option<Vec<TransactionStatus, Global>>;
    fn elasticity(&self, block_hash: <Block as Block>::Hash) -> Option<Permill>;
    fn is_eip1559(&self, block_hash: <Block as Block>::Hash) -> bool;
}
Expand description

Something that can fetch Ethereum-related data. This trait is quite similar to the runtime API, and indeed oe implementation of it uses the runtime API. Having this trait is useful because it allows optimized implementations that fetch data from a State Backend with some assumptions about pallet-ethereum’s storage schema. Using such an optimized implementation avoids spawning a runtime and the overhead associated with it.

Required Methods§

source

fn account_code_at( &self, block_hash: <Block as Block>::Hash, address: H160 ) -> Option<Vec<u8, Global>>

For a given account address, returns pallet_evm::AccountCodes.

source

fn storage_at( &self, block_hash: <Block as Block>::Hash, address: H160, index: U256 ) -> Option<H256>

For a given account address and index, returns pallet_evm::AccountStorages.

source

fn current_block( &self, block_hash: <Block as Block>::Hash ) -> Option<Block<TransactionV2>>

Return the current block.

source

fn current_receipts( &self, block_hash: <Block as Block>::Hash ) -> Option<Vec<ReceiptV3, Global>>

Return the current receipt.

source

fn current_transaction_statuses( &self, block_hash: <Block as Block>::Hash ) -> Option<Vec<TransactionStatus, Global>>

Return the current transaction status.

source

fn elasticity(&self, block_hash: <Block as Block>::Hash) -> Option<Permill>

Return the base fee at the given height.

source

fn is_eip1559(&self, block_hash: <Block as Block>::Hash) -> bool

Return true if the request BlockId is post-eip1559.

Implementors§

source§

impl<B, C, BE> StorageOverride<B> for SchemaV1Override<B, C, BE>where B: Block, C: HeaderBackend<B> + StorageProvider<B, BE> + 'static, BE: Backend<B> + 'static,

source§

impl<B, C, BE> StorageOverride<B> for SchemaV2Override<B, C, BE>where B: Block, C: HeaderBackend<B> + StorageProvider<B, BE> + 'static, BE: Backend<B> + 'static,

source§

impl<B, C, BE> StorageOverride<B> for SchemaV3Override<B, C, BE>where B: Block, C: HeaderBackend<B> + StorageProvider<B, BE> + 'static, BE: Backend<B> + 'static,

source§

impl<Block, C> StorageOverride<Block> for RuntimeApiStorageOverride<Block, C>where Block: Block, C: ProvideRuntimeApi<Block> + Send + Sync, <C as ProvideRuntimeApi<Block>>::Api: EthereumRuntimeRPCApi<Block>,