@@ -2,10 +2,10 @@ use core::fmt::Debug;
22
33use alloc:: vec:: Vec ;
44use alloy_consensus:: {
5- Eip2718EncodableReceipt , Eip658Value , ReceiptEnvelope , ReceiptWithBloom , RlpDecodableReceipt ,
6- RlpEncodableReceipt , TxReceipt , TxType , Typed2718 ,
5+ Eip2718DecodableReceipt , Eip2718EncodableReceipt , Eip658Value , ReceiptEnvelope ,
6+ ReceiptWithBloom , RlpDecodableReceipt , RlpEncodableReceipt , TxReceipt , TxType , Typed2718 ,
77} ;
8- use alloy_eips:: eip2718:: { Eip2718Error , Encodable2718 , IsTyped2718 } ;
8+ use alloy_eips:: eip2718:: { Eip2718Error , Eip2718Result , Encodable2718 , IsTyped2718 } ;
99use alloy_primitives:: { Bloom , Log , B256 } ;
1010use alloy_rlp:: { BufMut , Decodable , Encodable , Header , RlpDecodable , RlpEncodable } ;
1111use reth_primitives_traits:: { proofs:: ordered_trie_root_with_encoder, InMemorySize } ;
@@ -154,6 +154,16 @@ impl<T: TxTy> Eip2718EncodableReceipt for Receipt<T> {
154154 }
155155}
156156
157+ impl < T : TxTy > Eip2718DecodableReceipt for Receipt < T > {
158+ fn typed_decode_with_bloom ( ty : u8 , buf : & mut & [ u8 ] ) -> Eip2718Result < ReceiptWithBloom < Self > > {
159+ Ok ( Self :: rlp_decode_inner ( buf, T :: try_from ( ty) ?) ?)
160+ }
161+
162+ fn fallback_decode_with_bloom ( buf : & mut & [ u8 ] ) -> Eip2718Result < ReceiptWithBloom < Self > > {
163+ Ok ( Self :: rlp_decode_inner ( buf, T :: try_from ( 0 ) ?) ?)
164+ }
165+ }
166+
157167impl < T : TxTy > RlpEncodableReceipt for Receipt < T > {
158168 fn rlp_encoded_length_with_bloom ( & self , bloom : & Bloom ) -> usize {
159169 let mut len = self . eip2718_encoded_length_with_bloom ( bloom) ;
0 commit comments