@@ -25,11 +25,13 @@ fn test_get_class_hash_at(runnable_version: RunnableCairo1) {
25
25
let mut state = test_state ( chain_info, BALANCE , & [ ( test_contract, 1 ) ] ) ;
26
26
let address = contract_address ! ( "0x111" ) ;
27
27
let class_hash = class_hash ! ( "0x222" ) ;
28
+ let class_hash_of_undeployed_contract = felt ! ( "0x0" ) ;
29
+ let non_existing_address = felt ! ( "0x333" ) ;
28
30
state. state . address_to_class_hash . insert ( address, class_hash) ;
29
31
30
32
// Test deployed contract.
31
33
let positive_entry_point_call = CallEntryPoint {
32
- calldata : calldata ! [ address. into( ) , class_hash. 0 ] ,
34
+ calldata : calldata ! [ address. into( ) , class_hash. 0 , non_existing_address ] ,
33
35
entry_point_selector : selector_from_name ( "test_get_class_hash_at" ) ,
34
36
..trivial_external_entry_point_new ( test_contract)
35
37
} ;
@@ -51,18 +53,20 @@ fn test_get_class_hash_at(runnable_version: RunnableCairo1) {
51
53
l2_to_l1_messages: [],
52
54
cairo_native: false,
53
55
failed: false,
54
- gas_consumed: 16460 ,
56
+ gas_consumed: 29070 ,
55
57
}
56
58
"# ] ]
57
59
. assert_debug_eq ( & positive_call_info. execution ) ;
58
60
assert ! ( !positive_call_info. execution. failed) ;
59
61
assert_eq ! ( positive_call_info. execution. retdata, retdata![ ] ) ;
60
- // Test undeployed contract - should return class_hash = 0 and succeed.
61
- let non_existing_address = felt ! ( "0x333" ) ;
62
- let class_hash_of_undeployed_contract = felt ! ( "0x0" ) ;
63
62
63
+ // Test undeployed contract - should return class_hash = 0 and succeed.
64
64
let negative_entry_point_call = CallEntryPoint {
65
- calldata : calldata ! [ non_existing_address, class_hash_of_undeployed_contract] ,
65
+ calldata : calldata ! [
66
+ non_existing_address,
67
+ class_hash_of_undeployed_contract,
68
+ non_existing_address
69
+ ] ,
66
70
entry_point_selector : selector_from_name ( "test_get_class_hash_at" ) ,
67
71
..trivial_external_entry_point_new ( test_contract)
68
72
} ;
@@ -71,7 +75,7 @@ fn test_get_class_hash_at(runnable_version: RunnableCairo1) {
71
75
// Sanity check: giving the wrong expected class hash to the test should make it fail.
72
76
let different_class_hash = class_hash ! ( "0x444" ) ;
73
77
let different_class_hash_entry_point_call = CallEntryPoint {
74
- calldata : calldata ! [ address. into( ) , different_class_hash. 0 ] ,
78
+ calldata : calldata ! [ address. into( ) , different_class_hash. 0 , non_existing_address ] ,
75
79
entry_point_selector : selector_from_name ( "test_get_class_hash_at" ) ,
76
80
..trivial_external_entry_point_new ( test_contract)
77
81
} ;
0 commit comments