@@ -11,13 +11,15 @@ use starknet_in_rust::{
11
11
constants:: { TRANSACTION_VERSION , VALIDATE_ENTRY_POINT_SELECTOR } ,
12
12
} ,
13
13
hash_utils:: calculate_contract_address,
14
- services:: api:: contract_classes:: deprecated_contract_class:: ContractClass ,
14
+ services:: api:: contract_classes:: {
15
+ compiled_class:: CompiledClass , deprecated_contract_class:: ContractClass ,
16
+ } ,
15
17
state:: in_memory_state_reader:: InMemoryStateReader ,
16
18
state:: { cached_state:: CachedState , state_api:: State } ,
17
19
transaction:: { declare:: Declare , Deploy , DeployAccount , InvokeFunction } ,
18
20
utils:: Address ,
19
21
} ;
20
- use std:: { hint:: black_box, sync:: Arc } ;
22
+ use std:: { collections :: HashMap , hint:: black_box, sync:: Arc } ;
21
23
22
24
lazy_static ! {
23
25
// include_str! doesn't seem to work in CI
@@ -61,10 +63,13 @@ fn deploy_account() {
61
63
const RUNS : usize = 500 ;
62
64
63
65
let state_reader = Arc :: new ( InMemoryStateReader :: default ( ) ) ;
64
- let mut state = CachedState :: new ( state_reader, Some ( Default :: default ( ) ) , None ) ;
66
+ let mut state = CachedState :: new ( state_reader, HashMap :: new ( ) ) ;
65
67
66
68
state
67
- . set_contract_class ( & CLASS_HASH_BYTES , & CONTRACT_CLASS )
69
+ . set_contract_class (
70
+ & CLASS_HASH_BYTES ,
71
+ & CompiledClass :: Deprecated ( Arc :: new ( CONTRACT_CLASS . clone ( ) ) ) ,
72
+ )
68
73
. unwrap ( ) ;
69
74
70
75
let block_context = & Default :: default ( ) ;
@@ -97,7 +102,7 @@ fn declare() {
97
102
const RUNS : usize = 5 ;
98
103
99
104
let state_reader = Arc :: new ( InMemoryStateReader :: default ( ) ) ;
100
- let state = CachedState :: new ( state_reader, Some ( Default :: default ( ) ) , None ) ;
105
+ let state = CachedState :: new ( state_reader, HashMap :: new ( ) ) ;
101
106
102
107
let block_context = & Default :: default ( ) ;
103
108
@@ -129,10 +134,13 @@ fn deploy() {
129
134
const RUNS : usize = 8 ;
130
135
131
136
let state_reader = Arc :: new ( InMemoryStateReader :: default ( ) ) ;
132
- let mut state = CachedState :: new ( state_reader, Some ( Default :: default ( ) ) , None ) ;
137
+ let mut state = CachedState :: new ( state_reader, HashMap :: new ( ) ) ;
133
138
134
139
state
135
- . set_contract_class ( & CLASS_HASH_BYTES , & CONTRACT_CLASS )
140
+ . set_contract_class (
141
+ & CLASS_HASH_BYTES ,
142
+ & CompiledClass :: Deprecated ( Arc :: new ( CONTRACT_CLASS . clone ( ) ) ) ,
143
+ )
136
144
. unwrap ( ) ;
137
145
138
146
let block_context = & Default :: default ( ) ;
@@ -164,10 +172,13 @@ fn invoke() {
164
172
const RUNS : usize = 100 ;
165
173
166
174
let state_reader = Arc :: new ( InMemoryStateReader :: default ( ) ) ;
167
- let mut state = CachedState :: new ( state_reader, Some ( Default :: default ( ) ) , None ) ;
175
+ let mut state = CachedState :: new ( state_reader, HashMap :: new ( ) ) ;
168
176
169
177
state
170
- . set_contract_class ( & CLASS_HASH_BYTES , & CONTRACT_CLASS )
178
+ . set_contract_class (
179
+ & CLASS_HASH_BYTES ,
180
+ & CompiledClass :: Deprecated ( Arc :: new ( CONTRACT_CLASS . clone ( ) ) ) ,
181
+ )
171
182
. unwrap ( ) ;
172
183
173
184
let block_context = & Default :: default ( ) ;
0 commit comments