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:
@ -64,4 +64,4 @@ arbitrary = [
|
|||||||
"dep:proptest",
|
"dep:proptest",
|
||||||
"dep:proptest-arbitrary-interop",
|
"dep:proptest-arbitrary-interop",
|
||||||
]
|
]
|
||||||
serde-bincode-compat = ["serde_with", "alloy-consensus/serde-bincode-compat"]
|
serde-bincode-compat = ["serde_with", "alloy-consensus/serde-bincode-compat"]
|
||||||
@ -20,6 +20,9 @@ pub use constants::gas_units::{format_gas, format_gas_throughput};
|
|||||||
pub mod account;
|
pub mod account;
|
||||||
pub use account::{Account, Bytecode};
|
pub use account::{Account, Bytecode};
|
||||||
|
|
||||||
|
pub mod receipt;
|
||||||
|
pub use receipt::Receipt;
|
||||||
|
|
||||||
mod integer_list;
|
mod integer_list;
|
||||||
pub use integer_list::{IntegerList, IntegerListError};
|
pub use integer_list::{IntegerList, IntegerListError};
|
||||||
|
|
||||||
|
|||||||
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