Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix: state error unavailable contract address format
Browse files Browse the repository at this point in the history
commit-id:def3bf73
  • Loading branch information
AvivYossef-starkware committed Jul 14, 2024
1 parent 2b23e50 commit 9fa5685
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion crates/blockifier/src/state/error_format_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use starknet_api::core::ClassHash;
use starknet_api::core::{ClassHash, ContractAddress};
use starknet_types_core::felt::Felt;

use crate::state::errors::StateError;
Expand All @@ -12,3 +12,13 @@ fn test_error_undeclared_class_hash_format() {
not declared."
);
}

#[test]
fn test_error_unavailable_contract_address_format() {
let error = StateError::UnavailableContractAddress(ContractAddress::from(10_u128));
assert_eq!(
error.to_string(),
"Requested 0x000000000000000000000000000000000000000000000000000000000000000a is \
unavailable for deployment."
);
}
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("Requested {:#064x} is unavailable for deployment.",***.0)]
UnavailableContractAddress(ContractAddress),
#[error("Class with hash {:#064x} is not declared.", **.0)]
UndeclaredClassHash(ClassHash),
Expand Down

0 comments on commit 9fa5685

Please sign in to comment.