@@ -151,15 +151,15 @@ fn bench_cache(c: &mut Criterion) {
151151 unsafe { Cache :: new ( options. clone ( ) ) . unwrap ( ) } ;
152152
153153 b. iter ( || {
154- let result = cache. save_wasm ( HACKATOM ) ;
154+ let result = cache. store_code ( HACKATOM , true , true ) ;
155155 assert ! ( result. is_ok( ) ) ;
156156 } ) ;
157157 } ) ;
158158
159159 group. bench_function ( "load wasm" , |b| {
160160 let cache: Cache < MockApi , MockStorage , MockQuerier > =
161161 unsafe { Cache :: new ( options. clone ( ) ) . unwrap ( ) } ;
162- let checksum = cache. save_wasm ( HACKATOM ) . unwrap ( ) ;
162+ let checksum = cache. store_code ( HACKATOM , true , true ) . unwrap ( ) ;
163163
164164 b. iter ( || {
165165 let result = cache. load_wasm ( & checksum) ;
@@ -172,7 +172,7 @@ fn bench_cache(c: &mut Criterion) {
172172 let mut cache: Cache < MockApi , MockStorage , MockQuerier > =
173173 unsafe { Cache :: new ( options) . unwrap ( ) } ;
174174 cache. set_module_unchecked ( true ) ;
175- let checksum = cache. save_wasm ( HACKATOM ) . unwrap ( ) ;
175+ let checksum = cache. store_code ( HACKATOM , true , true ) . unwrap ( ) ;
176176
177177 b. iter ( || {
178178 let result = cache. load_wasm ( & checksum) ;
@@ -184,7 +184,7 @@ fn bench_cache(c: &mut Criterion) {
184184 let contract_wasm = fs:: read ( format ! ( "testdata/{contract_name}" ) ) . unwrap ( ) ;
185185 let cache: Cache < MockApi , MockStorage , MockQuerier > =
186186 unsafe { Cache :: new ( options. clone ( ) ) . unwrap ( ) } ;
187- let checksum = cache. save_wasm ( & contract_wasm) . unwrap ( ) ;
187+ let checksum = cache. store_code ( & contract_wasm, true , true ) . unwrap ( ) ;
188188
189189 group. bench_function ( format ! ( "analyze_{contract_name}" ) , |b| {
190190 b. iter ( || {
@@ -203,7 +203,7 @@ fn bench_cache(c: &mut Criterion) {
203203 ) ;
204204 let cache: Cache < MockApi , MockStorage , MockQuerier > =
205205 unsafe { Cache :: new ( non_memcache) . unwrap ( ) } ;
206- let checksum = cache. save_wasm ( HACKATOM ) . unwrap ( ) ;
206+ let checksum = cache. store_code ( HACKATOM , true , true ) . unwrap ( ) ;
207207
208208 b. iter ( || {
209209 let _ = cache
@@ -226,7 +226,7 @@ fn bench_cache(c: &mut Criterion) {
226226 let mut cache: Cache < MockApi , MockStorage , MockQuerier > =
227227 unsafe { Cache :: new ( non_memcache) . unwrap ( ) } ;
228228 cache. set_module_unchecked ( true ) ;
229- let checksum = cache. save_wasm ( HACKATOM ) . unwrap ( ) ;
229+ let checksum = cache. store_code ( HACKATOM , true , true ) . unwrap ( ) ;
230230
231231 b. iter ( || {
232232 let _ = cache
@@ -321,8 +321,8 @@ fn bench_instance_threads(c: &mut Criterion) {
321321 // Splice data in contract
322322 contract. splice ( offset..offset + leb128_buf. len ( ) , leb128_buf) ;
323323
324- cache. save_wasm ( contract. as_slice ( ) ) . unwrap ( )
325- // let checksum = cache.save_wasm (contract.as_slice()).unwrap();
324+ cache. store_code ( contract. as_slice ( ) , true , true ) . unwrap ( )
325+ // let checksum = cache.store_code (contract.as_slice(), true, true ).unwrap();
326326 // Preload into memory
327327 // cache
328328 // .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS)
@@ -381,7 +381,7 @@ fn bench_combined(c: &mut Criterion) {
381381 let checksum: Checksum = {
382382 let cache: Cache < MockApi , MockStorage , MockQuerier > =
383383 unsafe { Cache :: new ( options. clone ( ) ) . unwrap ( ) } ;
384- cache. save_wasm ( CYBERPUNK ) . unwrap ( )
384+ cache. store_code ( CYBERPUNK , true , true ) . unwrap ( )
385385 } ;
386386
387387 group. bench_function ( "get instance from fs cache and execute" , |b| {
0 commit comments