@@ -108,25 +108,6 @@ impl Tx {
108108 }
109109}
110110
111- #[ derive( Debug ) ]
112- pub enum TxRef < ' a > {
113- Invoke ( & ' a InvokeTx ) ,
114- Declare ( & ' a DeclareTx ) ,
115- L1Handler ( & ' a L1HandlerTx ) ,
116- DeployAccount ( & ' a DeployAccountTx ) ,
117- }
118-
119- impl < ' a > From < TxRef < ' a > > for Tx {
120- fn from ( value : TxRef < ' a > ) -> Self {
121- match value {
122- TxRef :: Invoke ( tx) => Tx :: Invoke ( tx. clone ( ) ) ,
123- TxRef :: Declare ( tx) => Tx :: Declare ( tx. clone ( ) ) ,
124- TxRef :: L1Handler ( tx) => Tx :: L1Handler ( tx. clone ( ) ) ,
125- TxRef :: DeployAccount ( tx) => Tx :: DeployAccount ( tx. clone ( ) ) ,
126- }
127- }
128- }
129-
130111/// Represents a transaction that has all the necessary data to be executed.
131112#[ derive( Debug , Clone , From , PartialEq , Eq ) ]
132113pub enum ExecutableTx {
@@ -146,15 +127,6 @@ impl ExecutableTx {
146127 }
147128 }
148129
149- pub fn tx_ref ( & self ) -> TxRef < ' _ > {
150- match self {
151- ExecutableTx :: Invoke ( tx) => TxRef :: Invoke ( tx) ,
152- ExecutableTx :: L1Handler ( tx) => TxRef :: L1Handler ( tx) ,
153- ExecutableTx :: Declare ( tx) => TxRef :: Declare ( tx) ,
154- ExecutableTx :: DeployAccount ( tx) => TxRef :: DeployAccount ( tx) ,
155- }
156- }
157-
158130 pub fn r#type ( & self ) -> TxType {
159131 match self {
160132 ExecutableTx :: Invoke ( _) => TxType :: Invoke ,
@@ -748,12 +720,17 @@ pub struct TxWithHash {
748720
749721impl From < ExecutableTxWithHash > for TxWithHash {
750722 fn from ( tx : ExecutableTxWithHash ) -> Self {
751- Self { hash : tx. hash , transaction : tx. tx_ref ( ) . into ( ) }
723+ Self { hash : tx. hash , transaction : tx. transaction . into ( ) }
752724 }
753725}
754726
755- impl From < & ExecutableTxWithHash > for TxWithHash {
756- fn from ( tx : & ExecutableTxWithHash ) -> Self {
757- Self { hash : tx. hash , transaction : tx. tx_ref ( ) . into ( ) }
727+ impl From < ExecutableTx > for Tx {
728+ fn from ( tx : ExecutableTx ) -> Self {
729+ match tx {
730+ ExecutableTx :: Invoke ( tx) => Tx :: Invoke ( tx) ,
731+ ExecutableTx :: L1Handler ( tx) => Tx :: L1Handler ( tx) ,
732+ ExecutableTx :: Declare ( tx) => Tx :: Declare ( tx. transaction ) ,
733+ ExecutableTx :: DeployAccount ( tx) => Tx :: DeployAccount ( tx) ,
734+ }
758735 }
759736}
0 commit comments