Skip to main content

FoundryBlock

Trait FoundryBlock 

Source
pub trait FoundryBlock: Block {
    // Required methods
    fn set_number(&mut self, number: U256);
    fn set_beneficiary(&mut self, beneficiary: Address);
    fn set_timestamp(&mut self, timestamp: U256);
    fn set_gas_limit(&mut self, gas_limit: u64);
    fn set_basefee(&mut self, basefee: u64);
    fn set_difficulty(&mut self, difficulty: U256);
    fn set_prevrandao(&mut self, prevrandao: Option<B256>);
    fn set_blob_excess_gas_and_price(
        &mut self,
        _excess_blob_gas: u64,
        _base_fee_update_fraction: u64,
    );
}
Expand description

Extension of [Block] with mutable setters, allowing EVM-agnostic mutation of block fields.

Required Methods§

Source

fn set_number(&mut self, number: U256)

Sets the block number.

Source

fn set_beneficiary(&mut self, beneficiary: Address)

Sets the beneficiary (coinbase) address.

Source

fn set_timestamp(&mut self, timestamp: U256)

Sets the block timestamp.

Source

fn set_gas_limit(&mut self, gas_limit: u64)

Sets the gas limit.

Source

fn set_basefee(&mut self, basefee: u64)

Sets the base fee per gas.

Source

fn set_difficulty(&mut self, difficulty: U256)

Sets the block difficulty.

Source

fn set_prevrandao(&mut self, prevrandao: Option<B256>)

Sets the prevrandao value.

Source

fn set_blob_excess_gas_and_price( &mut self, _excess_blob_gas: u64, _base_fee_update_fraction: u64, )

Sets the excess blob gas and blob gasprice.

Implementations on Foreign Types§

Source§

impl FoundryBlock for BlockEnv

Source§

fn set_number(&mut self, number: U256)

Source§

fn set_beneficiary(&mut self, beneficiary: Address)

Source§

fn set_timestamp(&mut self, timestamp: U256)

Source§

fn set_gas_limit(&mut self, gas_limit: u64)

Source§

fn set_basefee(&mut self, basefee: u64)

Source§

fn set_difficulty(&mut self, difficulty: U256)

Source§

fn set_prevrandao(&mut self, prevrandao: Option<B256>)

Source§

fn set_blob_excess_gas_and_price( &mut self, excess_blob_gas: u64, base_fee_update_fraction: u64, )

Implementors§