11//! Scroll L1 message transaction
22
33use crate :: ScrollTxType ;
4+ use std:: vec:: Vec ;
5+
46use alloy_consensus:: { Sealable , Transaction , Typed2718 } ;
57use alloy_eips:: eip2718:: { Decodable2718 , Eip2718Error , Eip2718Result , Encodable2718 } ;
68use alloy_primitives:: {
@@ -9,7 +11,6 @@ use alloy_primitives::{
911 Address , Bytes , ChainId , PrimitiveSignature as Signature , TxHash , TxKind , B256 , U256 ,
1012} ;
1113use alloy_rlp:: Decodable ;
12- use serde:: { Deserialize , Serialize } ;
1314#[ cfg( any( test, feature = "reth-codec" ) ) ]
1415use { reth_codecs:: Compact , reth_codecs_derive:: add_arbitrary_tests} ;
1516
@@ -301,11 +302,12 @@ impl Sealable for TxL1Message {
301302}
302303
303304/// Scroll specific transaction fields
304- #[ derive( Clone , Copy , Debug , Default , PartialEq , Eq , Serialize , Deserialize ) ]
305- #[ serde( rename_all = "camelCase" ) ]
305+ #[ derive( Clone , Copy , Debug , Default , PartialEq , Eq ) ]
306+ #[ cfg_attr( any( test, feature = "serde" ) , derive( serde:: Serialize , serde:: Deserialize ) ) ]
307+ #[ cfg_attr( any( test, feature = "serde" ) , serde( rename_all = "camelCase" ) ) ]
306308pub struct ScrollL1MessageTransactionFields {
307309 /// The index of the transaction in the message queue.
308- #[ serde( with = "alloy_serde::quantity" ) ]
310+ #[ cfg_attr ( any ( test , feature = " serde" ) , serde ( with = "alloy_serde::quantity" ) ) ]
309311 pub queue_index : u64 ,
310312 /// The sender of the transaction on the L1.
311313 pub sender : Address ,
0 commit comments