Skip to main content

FoundryBlock

Trait FoundryBlock 

pub trait FoundryBlock: Block {
    // Required methods
    fn set_number(&mut self, number: Uint<256, 4>);
    fn set_beneficiary(&mut self, beneficiary: Address);
    fn set_timestamp(&mut self, timestamp: Uint<256, 4>);
    fn set_gas_limit(&mut self, gas_limit: u64);
    fn set_basefee(&mut self, basefee: u64);
    fn set_difficulty(&mut self, difficulty: Uint<256, 4>);
    fn set_prevrandao(&mut self, prevrandao: Option<FixedBytes<32>>);
    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§

fn set_number(&mut self, number: Uint<256, 4>)

Sets the block number.

fn set_beneficiary(&mut self, beneficiary: Address)

Sets the beneficiary (coinbase) address.

fn set_timestamp(&mut self, timestamp: Uint<256, 4>)

Sets the block timestamp.

fn set_gas_limit(&mut self, gas_limit: u64)

Sets the gas limit.

fn set_basefee(&mut self, basefee: u64)

Sets the base fee per gas.

fn set_difficulty(&mut self, difficulty: Uint<256, 4>)

Sets the block difficulty.

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

Sets the prevrandao value.

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.

Implementors§