alloy_network

Trait HeaderResponse

source
pub trait HeaderResponse {
    // Required methods
    fn hash(&self) -> FixedBytes<32>;
    fn number(&self) -> u64;
    fn timestamp(&self) -> u64;
    fn extra_data(&self) -> &Bytes;
    fn base_fee_per_gas(&self) -> Option<u64>;
    fn next_block_blob_fee(&self) -> Option<u128>;
    fn coinbase(&self) -> Address;
    fn gas_limit(&self) -> u64;
    fn mix_hash(&self) -> Option<FixedBytes<32>>;
    fn difficulty(&self) -> Uint<256, 4>;
}
Expand description

Header JSON-RPC response.

Required Methods§

source

fn hash(&self) -> FixedBytes<32>

Block hash

source

fn number(&self) -> u64

Block number

source

fn timestamp(&self) -> u64

Block timestamp

source

fn extra_data(&self) -> &Bytes

Extra data

source

fn base_fee_per_gas(&self) -> Option<u64>

Base fee per unit of gas (If EIP-1559 is supported)

source

fn next_block_blob_fee(&self) -> Option<u128>

Blob fee for the next block (if EIP-4844 is supported)

source

fn coinbase(&self) -> Address

Coinbase/Miner of the block

source

fn gas_limit(&self) -> u64

Gas limit of the block

source

fn mix_hash(&self) -> Option<FixedBytes<32>>

Mix hash of the block

Before the merge this proves, combined with the nonce, that a sufficient amount of computation has been carried out on this block: the Proof-of-Work (PoW).

After the merge this is prevRandao: Randomness value for the generated payload.

This is an Option because it is not always set by non-ethereum networks.

See also https://eips.ethereum.org/EIPS/eip-4399 And https://github.com/ethereum/execution-apis/issues/328

source

fn difficulty(&self) -> Uint<256, 4>

Difficulty of the block

Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao.

Implementations on Foreign Types§

source§

impl HeaderResponse for Header

source§

impl<T> HeaderResponse for WithOtherFields<T>
where T: HeaderResponse,

Implementors§