From e04b7afa2ffcaa75b6add1165ce84e1457e332e1 Mon Sep 17 00:00:00 2001 From: AvivYossef-starkware <141143145+AvivYossef-starkware@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:15:48 +0300 Subject: [PATCH] refactor(blockifier): unavailable contract address error (#970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change is [Reviewable](https://reviewable.io/reviews/starkware-libs/sequencer/970) --- .../execution/deprecated_syscalls/deprecated_syscalls_test.rs | 2 +- .../blockifier/src/execution/syscalls/syscall_tests/deploy.rs | 2 +- crates/blockifier/src/state/errors.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs b/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs index 07a5beb1d7..a462132bb4 100644 --- a/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs +++ b/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs @@ -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( diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs index 6cdf5b780f..c9193774e2 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs @@ -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:")); } diff --git a/crates/blockifier/src/state/errors.rs b/crates/blockifier/src/state/errors.rs index 5347d182f7..1eba9b18bf 100644 --- a/crates/blockifier/src/state/errors.rs +++ b/crates/blockifier/src/state/errors.rs @@ -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),