pub trait StorageOverride<Block: BlockT>: Send + Sync {
    // Required methods
    fn account_code_at(
        &self,
        block_hash: Block::Hash,
        address: H160
    ) -> Option<Vec<u8>>;
    fn storage_at(
        &self,
        block_hash: Block::Hash,
        address: H160,
        index: U256
    ) -> Option<H256>;
    fn current_block(&self, block_hash: Block::Hash) -> Option<EthereumBlock>;
    fn current_receipts(
        &self,
        block_hash: Block::Hash
    ) -> Option<Vec<ReceiptV3>>;
    fn current_transaction_statuses(
        &self,
        block_hash: Block::Hash
    ) -> Option<Vec<TransactionStatus>>;
    fn elasticity(&self, block_hash: Block::Hash) -> Option<Permill>;
    fn is_eip1559(&self, block_hash: 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::Hash, address: H160 ) -> Option<Vec<u8>>

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

source

fn storage_at( &self, block_hash: 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::Hash) -> Option<EthereumBlock>

Return the current block.

source

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

Return the current receipt.

source

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

Return the current transaction status.

source

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

Return the base fee at the given height.

source

fn is_eip1559(&self, block_hash: 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: BlockT, 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: BlockT, 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: BlockT, C: HeaderBackend<B> + StorageProvider<B, BE> + 'static, BE: Backend<B> + 'static,

source§

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