Skip to content

Commit

Permalink
refactor(blockifier): unavailable contract address error (#970)
Browse files Browse the repository at this point in the history
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/starkware-libs/sequencer/970)
<!-- Reviewable:end -->
  • Loading branch information
AvivYossef-starkware authored Sep 24, 2024
1 parent 70c7b82 commit e04b7af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ fn test_replace_class() {
)]
#[case::deploy_to_unavailable_address(
true, true, false, true,
Some("is unavailable for deployment.".to_string())
Some("Deployment failed:".to_string())
// With constructor, nontrivial calldata, address unavailable, deploy from zero; Negative flow.
)]
#[case::corrupt_deploy_from_zero(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ fn to_unavailable_address(deployer_contract: FeatureContract) {
entry_point_call.clone().execute_directly(&mut state).unwrap();
let error = entry_point_call.execute_directly(&mut state).unwrap_err().to_string();

assert!(error.contains("is unavailable for deployment."));
assert!(error.contains("Deployment failed:"));
}
2 changes: 1 addition & 1 deletion crates/blockifier/src/state/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum StateError {
OutOfRangeContractAddress,
#[error(transparent)]
ProgramError(#[from] ProgramError),
#[error("Requested {0:?} is unavailable for deployment.")]
#[error("Deployment failed: contract already deployed at address {:#064x}", ***.0)]
UnavailableContractAddress(ContractAddress),
#[error("Class with hash {:#064x} is not declared.", **.0)]
UndeclaredClassHash(ClassHash),
Expand Down

0 comments on commit e04b7af

Please sign in to comment.