Skip to main content

tempo_primitives/reth_compat/
subblock.rs

1use crate::subblock::{RecoveredSubBlock, SignedSubBlock};
2use alloy_primitives::B256;
3
4impl SignedSubBlock {
5    /// Attempts to recover the senders and convert the subblock into a [`RecoveredSubBlock`].
6    ///
7    /// Note that the validator is assumed to be pre-validated to match the submitted signature.
8    pub fn try_into_recovered(
9        self,
10        validator: B256,
11    ) -> Result<RecoveredSubBlock, alloy_consensus::crypto::RecoveryError> {
12        let senders =
13            reth_primitives_traits::transaction::recover::recover_signers(&self.transactions)?;
14
15        Ok(RecoveredSubBlock::new_unchecked(self, senders, validator))
16    }
17}