mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: add debug_getrawTransactions (#5682)
This commit is contained in:
@ -187,11 +187,32 @@ pub trait BlockReaderIdExt: BlockReader + BlockIdReader + ReceiptProviderIdExt {
|
||||
self.sealed_header_by_id(BlockNumberOrTag::Finalized.into())
|
||||
}
|
||||
|
||||
/// Returns the block with the matching `BlockId` from the database.
|
||||
/// Returns the block with the matching [BlockId] from the database.
|
||||
///
|
||||
/// Returns `None` if block is not found.
|
||||
fn block_by_id(&self, id: BlockId) -> ProviderResult<Option<Block>>;
|
||||
|
||||
/// Returns the block with senders with matching [BlockId].
|
||||
///
|
||||
/// Returns the block's transactions in the requested variant.
|
||||
///
|
||||
/// Returns `None` if block is not found.
|
||||
fn block_with_senders_by_id(
|
||||
&self,
|
||||
id: BlockId,
|
||||
transaction_kind: TransactionVariant,
|
||||
) -> ProviderResult<Option<BlockWithSenders>> {
|
||||
match id {
|
||||
BlockId::Hash(hash) => {
|
||||
self.block_with_senders(hash.block_hash.into(), transaction_kind)
|
||||
}
|
||||
BlockId::Number(num) => self.convert_block_number(num)?.map_or_else(
|
||||
|| Ok(None),
|
||||
|num| self.block_with_senders(num.into(), transaction_kind),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the header with matching tag from the database
|
||||
///
|
||||
/// Returns `None` if header is not found.
|
||||
|
||||
Reference in New Issue
Block a user