33
44use crate :: core:: deployment:: deployer:: stylus_constructorCall;
55use crate :: core:: deployment:: deployer:: StylusDeployer :: deployCall;
6- use crate :: core:: verification:: VerificationError :: InvalidInitData ;
6+ use crate :: core:: verification:: VerificationError :: {
7+ InvalidInitData , TransactionReceiptError , TxNotSuccessful ,
8+ } ;
79use crate :: {
810 core:: { deployment:: prelude:: DeploymentCalldata , project:: contract:: Contract , reflection} ,
911 utils:: cargo,
@@ -25,6 +27,14 @@ pub async fn verify(
2527 . await ?
2628 . ok_or ( VerificationError :: NoCodeAtAddress ) ?;
2729 cargo:: clean ( ) ?;
30+ let deployment_success = provider
31+ . get_transaction_receipt ( tx_hash)
32+ . await ?
33+ . map ( |receipt| receipt. status ( ) )
34+ . ok_or ( TransactionReceiptError ) ?;
35+ if !deployment_success {
36+ return Err ( TxNotSuccessful ) ;
37+ }
2838 let status = contract. check ( None , & Default :: default ( ) , provider) . await ?;
2939
3040 let constructor_called = deployCall:: abi_decode ( tx. input ( ) )
@@ -118,4 +128,8 @@ pub enum VerificationError {
118128 NoConstructor ,
119129 #[ error( "Invalid init data: Constructor not called" ) ]
120130 InvalidInitData ,
131+ #[ error( "Transaction receipt error" ) ]
132+ TransactionReceiptError ,
133+ #[ error( "Deployment transaction not successful" ) ]
134+ TxNotSuccessful ,
121135}
0 commit comments