reth_era/common/decode.rs
1//! Compressed data decoding utilities.
2
3use crate::e2s::error::E2sError;
4use alloy_rlp::Decodable;
5use ssz::Decode;
6
7/// Extension trait for generic decoding from compressed data
8pub trait DecodeCompressedRlp {
9 /// Decompress and decode the data into the given type
10 fn decode<T: Decodable>(&self) -> Result<T, E2sError>;
11}
12
13/// Extension trait for generic decoding from compressed ssz data
14pub trait DecodeCompressedSsz {
15 /// Decompress and decode the SSZ data into the given type
16 fn decode<T: Decode>(&self) -> Result<T, E2sError>;
17}