@@ -107,6 +107,25 @@ pub struct DeployAccountTxReceipt {
107107 pub contract_address : ContractAddress ,
108108}
109109
110+ /// Receipt for a `Deploy` transaction.
111+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
112+ #[ cfg_attr( feature = "arbitrary" , derive( arbitrary:: Arbitrary ) ) ]
113+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
114+ pub struct DeployTxReceipt {
115+ /// Information about the transaction fee.
116+ pub fee : FeeInfo ,
117+ /// Events emitted by contracts.
118+ pub events : Vec < Event > ,
119+ /// Messages sent to L1.
120+ pub messages_sent : Vec < MessageToL1 > ,
121+ /// Revert error message if the transaction execution failed.
122+ pub revert_error : Option < String > ,
123+ /// The execution resources used by the transaction.
124+ pub execution_resources : ExecutionResources ,
125+ /// Contract address of the deployed contract.
126+ pub contract_address : ContractAddress ,
127+ }
128+
110129/// The receipt of a transaction containing the outputs of its execution.
111130#[ derive( Debug , Clone , PartialEq , Eq ) ]
112131#[ cfg_attr( feature = "arbitrary" , derive( arbitrary:: Arbitrary ) ) ]
@@ -116,6 +135,7 @@ pub enum Receipt {
116135 Declare ( DeclareTxReceipt ) ,
117136 L1Handler ( L1HandlerTxReceipt ) ,
118137 DeployAccount ( DeployAccountTxReceipt ) ,
138+ Deploy ( DeployTxReceipt ) ,
119139}
120140
121141impl Receipt {
@@ -129,6 +149,7 @@ impl Receipt {
129149 /// Returns the revert reason if the transaction is reverted.
130150 pub fn revert_reason ( & self ) -> Option < & str > {
131151 match self {
152+ Receipt :: Deploy ( rct) => rct. revert_error . as_deref ( ) ,
132153 Receipt :: Invoke ( rct) => rct. revert_error . as_deref ( ) ,
133154 Receipt :: Declare ( rct) => rct. revert_error . as_deref ( ) ,
134155 Receipt :: L1Handler ( rct) => rct. revert_error . as_deref ( ) ,
@@ -139,6 +160,7 @@ impl Receipt {
139160 /// Returns the L1 messages sent.
140161 pub fn messages_sent ( & self ) -> & [ MessageToL1 ] {
141162 match self {
163+ Receipt :: Deploy ( rct) => & rct. messages_sent ,
142164 Receipt :: Invoke ( rct) => & rct. messages_sent ,
143165 Receipt :: Declare ( rct) => & rct. messages_sent ,
144166 Receipt :: L1Handler ( rct) => & rct. messages_sent ,
@@ -149,6 +171,7 @@ impl Receipt {
149171 /// Returns the events emitted.
150172 pub fn events ( & self ) -> & [ Event ] {
151173 match self {
174+ Receipt :: Deploy ( rct) => & rct. events ,
152175 Receipt :: Invoke ( rct) => & rct. events ,
153176 Receipt :: Declare ( rct) => & rct. events ,
154177 Receipt :: L1Handler ( rct) => & rct. events ,
@@ -159,6 +182,7 @@ impl Receipt {
159182 /// Returns the execution resources used.
160183 pub fn resources_used ( & self ) -> & ExecutionResources {
161184 match self {
185+ Receipt :: Deploy ( rct) => & rct. execution_resources ,
162186 Receipt :: Invoke ( rct) => & rct. execution_resources ,
163187 Receipt :: Declare ( rct) => & rct. execution_resources ,
164188 Receipt :: L1Handler ( rct) => & rct. execution_resources ,
@@ -168,6 +192,7 @@ impl Receipt {
168192
169193 pub fn fee ( & self ) -> & FeeInfo {
170194 match self {
195+ Receipt :: Deploy ( rct) => & rct. fee ,
171196 Receipt :: Invoke ( rct) => & rct. fee ,
172197 Receipt :: Declare ( rct) => & rct. fee ,
173198 Receipt :: L1Handler ( rct) => & rct. fee ,
@@ -178,6 +203,7 @@ impl Receipt {
178203 /// Returns the transaction tyoe of the receipt.
179204 pub fn r#type ( & self ) -> TxType {
180205 match self {
206+ Receipt :: Deploy ( _) => TxType :: Deploy ,
181207 Receipt :: Invoke ( _) => TxType :: Invoke ,
182208 Receipt :: Declare ( _) => TxType :: Declare ,
183209 Receipt :: L1Handler ( _) => TxType :: L1Handler ,
0 commit comments