pub trait StorageOverride<Block>: Send + Sync
where Block: Block,
{ // Required methods fn account_code_at( &self, block_hash: <Block as Block>::Hash, address: H160 ) -> Option<Vec<u8>>; 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>>; fn current_transaction_statuses( &self, block_hash: <Block as Block>::Hash ) -> Option<Vec<TransactionStatus>>; 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§

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

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

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.

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

Return the current block.

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

Return the current receipt.

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

Return the current transaction status.

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

Return the base fee at the given height.

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

Return true if the request BlockId is post-eip1559.

Implementors§

§

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,

§

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,

§

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,

§

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