Skip to content

Commit

Permalink
Merge pull request #54 from semiotic-ai/pedro/back-153-move-changes-t…
Browse files Browse the repository at this point in the history
…o-firehose-protos-into-another-pr

Pedro/back 153 move changes to firehose protos into another pr
  • Loading branch information
pedrohba1 authored Nov 6, 2024
2 parents 144f29d + 91f3bbf commit 7e8c6c3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions crates/firehose-protos/src/ethereum_v2/eth_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ impl Block {
Ok(calculate_transaction_root(&transactions))
}

fn full_receipts(&self) -> Result<Vec<FullReceipt>, ProtosError> {
/// Converts the transaction traces of the current block into a vector of `FullReceipt` objects.
///
/// # Arguments
///
/// * `block` reference to the block containing the `Vec<FullReceipt>`
///
pub fn full_receipts(&self) -> Result<Vec<FullReceipt>, ProtosError> {
self.transaction_traces
.iter()
.map(FullReceipt::try_from)
Expand Down Expand Up @@ -261,7 +267,7 @@ impl Block {
}
}

struct FullReceipt {
pub struct FullReceipt {
receipt: ReceiptWithBloom,
state_root: Vec<u8>,
}
Expand Down Expand Up @@ -332,6 +338,11 @@ impl FullReceipt {
self.receipt.encode_inner(encoded, false);
}

/// Returns a reference to the [`ReceiptWithBloom`] for this [`FullReceipt`]
pub fn get_receipt_wb(&self) -> &ReceiptWithBloom {
&self.receipt
}

/// Encodes receipt header using [RLP serialization](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp)
fn rlp_header(&self) -> RlpHeader {
let payload_length = self.state_root.as_slice().length()
Expand Down

0 comments on commit 7e8c6c3

Please sign in to comment.