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,
    );

    // Provided methods
    fn timestamp_millis_part(&self) -> u64 { ... }
    fn set_timestamp_millis_part(&mut self, _millis: 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.

Provided Methods§

Source

fn timestamp_millis_part(&self) -> u64

Returns the milliseconds portion of the block timestamp.

Source

fn set_timestamp_millis_part(&mut self, _millis: u64)

Sets the milliseconds portion of the block timestamp.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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, )

Source§

impl FoundryBlock for TempoBlockEnv

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, )

Source§

fn timestamp_millis_part(&self) -> u64

Source§

fn set_timestamp_millis_part(&mut self, millis: u64)

Implementors§