This repository was archived by the owner on Aug 21, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
crates/blockifier/src/state Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010tmp_venv /*
1111
12+ .spr.yml
Original file line number Diff line number Diff line change 1- use starknet_api:: core:: ClassHash ;
1+ use starknet_api:: core:: { ClassHash , ContractAddress } ;
22use starknet_types_core:: felt:: Felt ;
33
44use crate :: state:: errors:: StateError ;
@@ -12,3 +12,13 @@ fn test_error_undeclared_class_hash_format() {
1212 not declared."
1313 ) ;
1414}
15+
16+ #[ test]
17+ fn test_error_unavailable_contract_address_format ( ) {
18+ let error = StateError :: UnavailableContractAddress ( ContractAddress :: from ( 10_u128 ) ) ;
19+ assert_eq ! (
20+ error. to_string( ) ,
21+ "Requested 0x000000000000000000000000000000000000000000000000000000000000000a is \
22+ unavailable for deployment."
23+ ) ;
24+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ pub enum StateError {
1919 OutOfRangeContractAddress ,
2020 #[ error( transparent) ]
2121 ProgramError ( #[ from] ProgramError ) ,
22- #[ error( "Requested {0:? } is unavailable for deployment." ) ]
22+ #[ error( "Requested {:#064x } is unavailable for deployment." , * * * . 0 ) ]
2323 UnavailableContractAddress ( ContractAddress ) ,
2424 #[ error( "Class with hash {:#064x} is not declared." , * * . 0 ) ]
2525 UndeclaredClassHash ( ClassHash ) ,
You can’t perform that action at this time.
0 commit comments