Type Alias SealedBlockWithSenders

pub type SealedBlockWithSenders<B = Block<TransactionSigned>> = RecoveredBlock<B>;
👎Deprecated: Use RecoveredBlock instead
Expand description

Ethereum recovered block

Aliased Type§

struct SealedBlockWithSenders<B = Block<TransactionSigned>> { /* private fields */ }

Layout§

Note: Encountered an error during type layout; the type failed to be normalized.

Implementations

§

impl<B> RecoveredBlock<B>
where B: Block,

pub fn new( block: B, senders: Vec<Address>, hash: FixedBytes<32>, ) -> RecoveredBlock<B>

Creates a new recovered block instance with the given senders as provided and the block hash.

Note: This expects that the given senders match the transactions in the block.

pub fn new_unhashed(block: B, senders: Vec<Address>) -> RecoveredBlock<B>

Creates a new recovered block instance with the given senders as provided.

Note: This expects that the given senders match the transactions in the block.

pub fn senders(&self) -> &[Address]

Returns the recovered senders.

pub fn senders_iter(&self) -> impl Iterator<Item = &Address>

Returns an iterator over the recovered senders.

pub fn into_block(self) -> B

Consumes the type and returns the inner block.

pub const fn sealed_block(&self) -> &SealedBlock<B>

Returns a reference to the sealed block.

pub const fn new_sealed( block: SealedBlock<B>, senders: Vec<Address>, ) -> RecoveredBlock<B>

Creates a new recovered block instance with the given SealedBlock and senders as provided

pub fn try_new( block: B, senders: Vec<Address>, hash: FixedBytes<32>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

A safer variant of Self::new_unhashed that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer to recover the senders.

pub fn try_new_unchecked( block: B, senders: Vec<Address>, hash: FixedBytes<32>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

A safer variant of Self::new that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer_unchecked to recover the senders.

pub fn try_new_unhashed( block: B, senders: Vec<Address>, ) -> Result<RecoveredBlock<B>, RecoveryError>

A safer variant of Self::new_unhashed that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer to recover the senders.

pub fn try_new_unhashed_unchecked( block: B, senders: Vec<Address>, ) -> Result<RecoveredBlock<B>, RecoveryError>

A safer variant of Self::new_unhashed that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer_unchecked to recover the senders.

pub fn try_recover(block: B) -> Result<RecoveredBlock<B>, RecoveryError>

Recovers the senders from the transactions in the block using SignedTransaction::recover_signer.

Returns an error if any of the transactions fail to recover the sender.

pub fn try_recover_unchecked( block: B, ) -> Result<RecoveredBlock<B>, RecoveryError>

Recovers the senders from the transactions in the block using SignedTransaction::recover_signer_unchecked.

Returns an error if any of the transactions fail to recover the sender.

pub fn try_recover_sealed( block: SealedBlock<B>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

Recovers the senders from the transactions in the block using SignedTransaction::recover_signer.

Returns an error if any of the transactions fail to recover the sender.

pub fn try_recover_sealed_unchecked( block: SealedBlock<B>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

Recovers the senders from the transactions in the sealed block using SignedTransaction::recover_signer_unchecked.

Returns an error if any of the transactions fail to recover the sender.

pub fn try_recover_sealed_with_senders( block: SealedBlock<B>, senders: Vec<Address>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

A safer variant of Self::new_unhashed that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer_unchecked to recover the senders.

Returns an error if any of the transactions fail to recover the sender.

pub fn try_recover_sealed_with_senders_unchecked( block: SealedBlock<B>, senders: Vec<Address>, ) -> Result<RecoveredBlock<B>, BlockRecoveryError<SealedBlock<B>>>

A safer variant of Self::new that checks if the number of senders is equal to the number of transactions in the block and recovers the senders from the transactions, if not using SignedTransaction::recover_signer_unchecked to recover the senders.

pub fn hash_ref(&self) -> &FixedBytes<32>

Returns the block hash.

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

Returns a copy of the block hash.

pub fn num_hash(&self) -> NumHash

Return the number hash tuple.

pub fn block_with_parent(&self) -> BlockWithParent

Return a [BlockWithParent] for this header.

pub fn clone_header(&self) -> <B as Block>::Header

Clone the header.

pub fn clone_sealed_header(&self) -> SealedHeader<<B as Block>::Header>

Clones the internal header and returns a SealedHeader sealed with the hash.

pub fn clone_sealed_block(&self) -> SealedBlock<B>

Clones the wrapped block and returns the SealedBlock sealed with the hash.

pub fn into_header(self) -> <B as Block>::Header

Consumes the block and returns the block’s header.

pub fn into_body(self) -> <B as Block>::Body

Consumes the block and returns the block’s body.

pub fn into_sealed_block(self) -> SealedBlock<B>

Consumes the block and returns the SealedBlock and drops the recovered senders.

pub fn split_sealed(self) -> (SealedBlock<B>, Vec<Address>)

Consumes the type and returns its components.

pub fn split(self) -> (B, Vec<Address>)

Consumes the type and returns its components.

pub fn transactions_with_sender( &self, ) -> impl Iterator<Item = (&Address, &<<B as Block>::Body as BlockBody>::Transaction)>

Returns an iterator over all transactions and their sender.

pub fn clone_transactions_recovered( &self, ) -> impl Iterator<Item = Recovered<<<B as Block>::Body as BlockBody>::Transaction>>

Returns an iterator over cloned Recovered<Transaction>

pub fn transactions_recovered( &self, ) -> impl Iterator<Item = Recovered<&<<B as Block>::Body as BlockBody>::Transaction>>

Returns an iterator over Recovered<&Transaction>

pub fn into_transactions_recovered( self, ) -> impl Iterator<Item = Recovered<<<B as Block>::Body as BlockBody>::Transaction>>

Consumes the type and returns an iterator over all Recovered transactions in the block.

pub fn into_transactions( self, ) -> Vec<<<B as Block>::Body as BlockBody>::Transaction>

Consumes the block and returns the transactions of the block.

§

impl<B> RecoveredBlock<B>
where B: Block,

pub fn senders_mut(&mut self) -> &mut Vec<Address>

Available on crate feature test-utils only.

Returns a mutable reference to the recovered senders.

pub fn push_sender(&mut self, sender: Address)

Available on crate feature test-utils only.

Appends the sender to the list of senders.

§

impl<B> RecoveredBlock<B>
where B: TestBlock,

pub fn set_header(&mut self, header: <B as Block>::Header)

Available on crate feature test-utils only.

Updates the block header.

pub fn set_hash(&mut self, hash: FixedBytes<32>)

Available on crate feature test-utils only.

Updates the block hash.

pub fn header_mut(&mut self) -> &mut <B as Block>::Header

Available on crate feature test-utils only.

Returns a mutable reference to the header.

pub fn block_mut(&mut self) -> &mut <B as Block>::Body

Available on crate feature test-utils only.

Returns a mutable reference to the header.

pub fn set_parent_hash(&mut self, hash: FixedBytes<32>)

Available on crate feature test-utils only.

Updates the parent block hash.

pub fn set_block_number(&mut self, number: u64)

Available on crate feature test-utils only.

Updates the block number.

pub fn set_state_root(&mut self, state_root: FixedBytes<32>)

Available on crate feature test-utils only.

Updates the block state root.

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

Available on crate feature test-utils only.

Updates the block difficulty.

Trait Implementations

§

impl<'a, B> Arbitrary<'a> for RecoveredBlock<B>
where B: Block + Arbitrary<'a>,

Available on crate feature arbitrary only.
§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<RecoveredBlock<B>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

impl<B> BlockHeader for RecoveredBlock<B>
where B: Block,

§

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

Retrieves the parent hash of the block
§

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

Retrieves the ommers hash of the block
§

fn beneficiary(&self) -> Address

Retrieves the beneficiary (miner) of the block
§

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

Retrieves the state root hash of the block
§

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

Retrieves the transactions root hash of the block
§

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

Retrieves the receipts root hash of the block
§

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

Retrieves the withdrawals root hash of the block, if available
§

fn logs_bloom(&self) -> Bloom

Retrieves the logs bloom filter of the block
§

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

Retrieves the difficulty of the block
§

fn number(&self) -> u64

Retrieves the block number
§

fn gas_limit(&self) -> u64

Retrieves the gas limit of the block
§

fn gas_used(&self) -> u64

Retrieves the gas used by the block
§

fn timestamp(&self) -> u64

Retrieves the timestamp of the block
§

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

Retrieves the mix hash of the block, if available
§

fn nonce(&self) -> Option<FixedBytes<8>>

Retrieves the nonce of the block, if avaialble
§

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

Retrieves the base fee per gas of the block, if available
§

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

Retrieves the blob gas used by the block, if available
§

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

Retrieves the excess blob gas of the block, if available
§

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

Retrieves the parent beacon block root of the block, if available
§

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

Retrieves the requests hash of the block, if available
§

fn extra_data(&self) -> &Bytes

Retrieves the block’s extra data field
§

fn blob_fee(&self, blob_params: BlobParams) -> Option<u128>

Returns the blob fee for this block according to the EIP-4844 spec. Read more
§

fn next_block_excess_blob_gas(&self, blob_params: BlobParams) -> Option<u64>

Calculate excess blob gas for the next block according to the EIP-4844 spec. Read more
§

fn maybe_next_block_excess_blob_gas( &self, blob_params: Option<BlobParams>, ) -> Option<u64>

Convenience function for Self::next_block_excess_blob_gas with an optional [BlobParams] argument. Read more
§

fn next_block_blob_fee(&self, blob_params: BlobParams) -> Option<u128>

Returns the blob fee for the next block according to the EIP-4844 spec. Read more
§

fn maybe_next_block_blob_fee( &self, blob_params: Option<BlobParams>, ) -> Option<u128>

Convenience function for Self::next_block_blob_fee with an optional [BlobParams] argument. Read more
§

fn next_block_base_fee(&self, base_fee_params: BaseFeeParams) -> Option<u64>

Calculate base fee for next block according to the EIP-1559 spec. Read more
§

fn parent_num_hash(&self) -> NumHash

Returns the parent block’s number and hash Read more
§

fn is_empty(&self) -> bool

Checks if the header is considered empty - has no transactions, no ommers or withdrawals
§

fn is_zero_difficulty(&self) -> bool

Checks if the block’s difficulty is set to zero, indicating a Proof-of-Stake header. Read more
§

fn exceeds_allowed_future_timestamp(&self, present_timestamp: u64) -> bool

Checks if the block’s timestamp is in the future based on the present timestamp. Read more
§

fn is_nonce_zero(&self) -> bool

Checks if the nonce exists, and if it exists, if it’s zero. Read more
§

impl<B> Clone for RecoveredBlock<B>
where B: Clone + Block,

§

fn clone(&self) -> RecoveredBlock<B>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<B> Debug for RecoveredBlock<B>
where B: Debug + Block,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<B> Default for RecoveredBlock<B>
where B: Block + Default,

§

fn default() -> RecoveredBlock<B>

Returns the “default value” for a type. Read more
§

impl<B> Deref for RecoveredBlock<B>
where B: Block,

§

type Target = SealedBlock<B>

The resulting type after dereferencing.
§

fn deref(&self) -> &<RecoveredBlock<B> as Deref>::Target

Dereferences the value.
§

impl<B> DerefMut for RecoveredBlock<B>
where B: Block,

Available on crate feature test-utils only.
§

fn deref_mut(&mut self) -> &mut <RecoveredBlock<B> as Deref>::Target

Mutably dereferences the value.
§

impl<'de, B> Deserialize<'de> for RecoveredBlock<B>

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RecoveredBlock<B>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<B> From<OrderedRecoveredBlock<B>> for RecoveredBlock<B>
where B: Block,

§

fn from(value: OrderedRecoveredBlock<B>) -> RecoveredBlock<B>

Converts to this type from the input type.
§

impl<'a, T> From<RecoveredBlock<'a, T>> for RecoveredBlock<T>
where T: Block + 'static, <T as Block>::Header: SerdeBincodeCompat, <T as Block>::Body: SerdeBincodeCompat,

§

fn from(value: RecoveredBlock<'a, T>) -> RecoveredBlock<T>

Converts to this type from the input type.
§

impl<B> InMemorySize for RecoveredBlock<B>
where B: Block,

§

fn size(&self) -> usize

Returns a heuristic for the in-memory size of a struct.
§

impl<B> PartialEq for RecoveredBlock<B>
where B: Block,

§

fn eq(&self, other: &RecoveredBlock<B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> SerdeBincodeCompat for RecoveredBlock<T>
where T: Block + 'static, <T as Block>::Header: SerdeBincodeCompat, <T as Block>::Body: SerdeBincodeCompat,

§

type BincodeRepr<'a> = RecoveredBlock<'a, T>

Serde representation of the type for bincode serialization. Read more
§

fn as_repr(&self) -> <RecoveredBlock<T> as SerdeBincodeCompat>::BincodeRepr<'_>

Convert this type into its bincode representation
§

fn from_repr( repr: <RecoveredBlock<T> as SerdeBincodeCompat>::BincodeRepr<'_>, ) -> RecoveredBlock<T>

Convert from the bincode representation
§

impl<B> Serialize for RecoveredBlock<B>

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<B> Eq for RecoveredBlock<B>
where B: Block,