Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace into_receipt by into #735

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ where
}
}

impl<T> From<ReceiptWithBloom<T>> for Receipt<T> {
/// Consume the structure, returning only the receipt
fn from(receipt_with_bloom: ReceiptWithBloom<T>) -> Self {
receipt_with_bloom.receipt
}
}

/// [`Receipt`] with calculated bloom filter.
///
/// This convenience type allows us to lazily calculate the bloom filter for a
Expand Down Expand Up @@ -137,14 +144,8 @@ impl<T: Encodable> ReceiptWithBloom<T> {

impl<T> ReceiptWithBloom<T> {
/// Create new [ReceiptWithBloom]
pub const fn new(receipt: Receipt<T>, bloom: Bloom) -> Self {
Self { receipt, logs_bloom: bloom }
}

/// Consume the structure, returning only the receipt
#[allow(clippy::missing_const_for_fn)] // false positive
pub fn into_receipt(self) -> Receipt<T> {
self.receipt
pub const fn new(receipt: Receipt<T>, logs_bloom: Bloom) -> Self {
Self { receipt, logs_bloom }
}

/// Consume the structure, returning the receipt and the bloom filter
Expand Down
Loading