reth::rpc::compat::block

Function from_block

Source
pub fn from_block<T, B>(
    block: BlockWithSenders<B>,
    kind: BlockTransactionsKind,
    block_hash: Option<FixedBytes<32>>,
    tx_resp_builder: &T,
) -> Result<Block<<T as TransactionCompat<<<B as Block>::Body as BlockBody>::Transaction>>::Transaction, Header<<B as Block>::Header>>, <T as TransactionCompat<<<B as Block>::Body as BlockBody>::Transaction>>::Error>
where T: TransactionCompat<<<B as Block>::Body as BlockBody>::Transaction>, B: Block,
Expand description

Converts the given primitive block into a Block response with the given BlockTransactionsKind

If a block_hash is provided, then this is used, otherwise the block hash is computed.