mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(sdk): define trait Receipt (#11643)
This commit is contained in:
29
crates/primitives-traits/src/receipt.rs
Normal file
29
crates/primitives-traits/src/receipt.rs
Normal file
@ -0,0 +1,29 @@
|
||||
//! Receipt abstraction
|
||||
|
||||
use alloc::fmt;
|
||||
|
||||
use alloy_consensus::TxReceipt;
|
||||
use reth_codecs::Compact;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Helper trait that unifies all behaviour required by receipt to support full node operations.
|
||||
pub trait FullReceipt: Receipt + Compact {}
|
||||
|
||||
impl<T> FullReceipt for T where T: Receipt + Compact {}
|
||||
|
||||
/// Abstraction of a receipt.
|
||||
pub trait Receipt:
|
||||
TxReceipt
|
||||
+ Clone
|
||||
+ fmt::Debug
|
||||
+ PartialEq
|
||||
+ Eq
|
||||
+ Default
|
||||
+ alloy_rlp::Encodable
|
||||
+ alloy_rlp::Decodable
|
||||
+ Serialize
|
||||
+ for<'de> Deserialize<'de>
|
||||
{
|
||||
/// Returns transaction type.
|
||||
fn tx_type(&self) -> u8;
|
||||
}
|
||||
Reference in New Issue
Block a user