Skip to content

Commit bb8eee6

Browse files
authored
Merge pull request #360 from OffchainLabs/afilios/nit-3610-verify-cargo-stylus-command-does-not-check-that-the
Verify cargo stylus command does not check that the transaction succe…
2 parents 4003c3f + fbe6705 commit bb8eee6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

stylus-tools/src/core/verification.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
use crate::core::deployment::deployer::stylus_constructorCall;
55
use crate::core::deployment::deployer::StylusDeployer::deployCall;
6-
use crate::core::verification::VerificationError::InvalidInitData;
6+
use crate::core::verification::VerificationError::{
7+
InvalidInitData, TransactionReceiptError, TxNotSuccessful,
8+
};
79
use 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

Comments
 (0)