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 15, 2024
1 parent d1ed414 commit 1802ea2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ target

tmp_venv/*

.spr.yml
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 1802ea2

Please sign in to comment.