@@ -14,7 +14,7 @@ import (
1414 "github.com/CosmWasm/wasmvm/types"
1515)
1616
17- const TESTING_FEATURES = "staking,stargate"
17+ const TESTING_FEATURES = "staking,stargate,iterator "
1818const TESTING_PRINT_DEBUG = false
1919const TESTING_GAS_LIMIT = 100_000_000
2020const TESTING_MEMORY_LIMIT = 32 // MiB
@@ -208,7 +208,7 @@ func TestGetMetrics(t *testing.T) {
208208 assert .Equal (t , & types.Metrics {
209209 HitsFsCache : 1 ,
210210 ElementsMemoryCache : 1 ,
211- SizeMemoryCache : 4977784 ,
211+ SizeMemoryCache : 4777334 ,
212212 }, metrics )
213213
214214 // Instantiate 2
@@ -223,7 +223,7 @@ func TestGetMetrics(t *testing.T) {
223223 HitsMemoryCache : 1 ,
224224 HitsFsCache : 1 ,
225225 ElementsMemoryCache : 1 ,
226- SizeMemoryCache : 4977784 ,
226+ SizeMemoryCache : 4777334 ,
227227 }, metrics )
228228
229229 // Pin
@@ -238,8 +238,8 @@ func TestGetMetrics(t *testing.T) {
238238 HitsFsCache : 1 ,
239239 ElementsPinnedMemoryCache : 1 ,
240240 ElementsMemoryCache : 1 ,
241- SizePinnedMemoryCache : 4977784 ,
242- SizeMemoryCache : 4977784 ,
241+ SizePinnedMemoryCache : 4777334 ,
242+ SizeMemoryCache : 4777334 ,
243243 }, metrics )
244244
245245 // Instantiate 3
@@ -256,8 +256,8 @@ func TestGetMetrics(t *testing.T) {
256256 HitsFsCache : 1 ,
257257 ElementsPinnedMemoryCache : 1 ,
258258 ElementsMemoryCache : 1 ,
259- SizePinnedMemoryCache : 4977784 ,
260- SizeMemoryCache : 4977784 ,
259+ SizePinnedMemoryCache : 4777334 ,
260+ SizeMemoryCache : 4777334 ,
261261 }, metrics )
262262
263263 // Unpin
@@ -274,7 +274,7 @@ func TestGetMetrics(t *testing.T) {
274274 ElementsPinnedMemoryCache : 0 ,
275275 ElementsMemoryCache : 1 ,
276276 SizePinnedMemoryCache : 0 ,
277- SizeMemoryCache : 4977784 ,
277+ SizeMemoryCache : 4777334 ,
278278 }, metrics )
279279
280280 // Instantiate 4
@@ -292,7 +292,7 @@ func TestGetMetrics(t *testing.T) {
292292 ElementsPinnedMemoryCache : 0 ,
293293 ElementsMemoryCache : 1 ,
294294 SizePinnedMemoryCache : 0 ,
295- SizeMemoryCache : 4977784 ,
295+ SizeMemoryCache : 4777334 ,
296296 }, metrics )
297297}
298298
@@ -319,7 +319,7 @@ func TestInstantiate(t *testing.T) {
319319 res , cost , err := Instantiate (cache , checksum , env , info , msg , & igasMeter , store , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
320320 require .NoError (t , err )
321321 requireOkResponse (t , res , 0 )
322- assert .Equal (t , uint64 (0x85b0 ), cost )
322+ assert .Equal (t , uint64 (0x8d8e ), cost )
323323
324324 var result types.ContractResult
325325 err = json .Unmarshal (res , & result )
@@ -350,7 +350,7 @@ func TestExecute(t *testing.T) {
350350 diff := time .Now ().Sub (start )
351351 require .NoError (t , err )
352352 requireOkResponse (t , res , 0 )
353- assert .Equal (t , uint64 (0x85b0 ), cost )
353+ assert .Equal (t , uint64 (0x8d8e ), cost )
354354 t .Logf ("Time (%d gas): %s\n " , cost , diff )
355355
356356 // execute with the same store
@@ -363,7 +363,7 @@ func TestExecute(t *testing.T) {
363363 res , cost , err = Execute (cache , checksum , env , info , []byte (`{"release":{}}` ), & igasMeter2 , store , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
364364 diff = time .Now ().Sub (start )
365365 require .NoError (t , err )
366- assert .Equal (t , uint64 (0xf0fd ), cost )
366+ assert .Equal (t , uint64 (0xf783 ), cost )
367367 t .Logf ("Time (%d gas): %s\n " , cost , diff )
368368
369369 // make sure it read the balance properly and we got 250 atoms
@@ -414,7 +414,7 @@ func TestExecuteCpuLoop(t *testing.T) {
414414 diff := time .Now ().Sub (start )
415415 require .NoError (t , err )
416416 requireOkResponse (t , res , 0 )
417- assert .Equal (t , uint64 (0x85b0 ), cost )
417+ assert .Equal (t , uint64 (0x8d8e ), cost )
418418 t .Logf ("Time (%d gas): %s\n " , cost , diff )
419419
420420 // execute a cpu loop
@@ -565,7 +565,7 @@ func TestMultipleInstances(t *testing.T) {
565565 require .NoError (t , err )
566566 requireOkResponse (t , res , 0 )
567567 // we now count wasm gas charges and db writes
568- assert .Equal (t , uint64 (0x84ad ), cost )
568+ assert .Equal (t , uint64 (0x8c97 ), cost )
569569
570570 // instance2 controlled by mary
571571 gasMeter2 := NewMockGasMeter (TESTING_GAS_LIMIT )
@@ -576,14 +576,14 @@ func TestMultipleInstances(t *testing.T) {
576576 res , cost , err = Instantiate (cache , checksum , env , info , msg , & igasMeter2 , store2 , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
577577 require .NoError (t , err )
578578 requireOkResponse (t , res , 0 )
579- assert .Equal (t , uint64 (0x8541 ), cost )
579+ assert .Equal (t , uint64 (0x8d25 ), cost )
580580
581581 // fail to execute store1 with mary
582- resp := exec (t , cache , checksum , "mary" , store1 , api , querier , 0x75ab )
582+ resp := exec (t , cache , checksum , "mary" , store1 , api , querier , 0x80a9 )
583583 require .Equal (t , "Unauthorized" , resp .Err )
584584
585585 // succeed to execute store1 with fred
586- resp = exec (t , cache , checksum , "fred" , store1 , api , querier , 0xf089 )
586+ resp = exec (t , cache , checksum , "fred" , store1 , api , querier , 0xf70f )
587587 require .Equal (t , "" , resp .Err )
588588 require .Equal (t , 1 , len (resp .Ok .Messages ))
589589 attributes := resp .Ok .Attributes
@@ -592,7 +592,7 @@ func TestMultipleInstances(t *testing.T) {
592592 require .Equal (t , "bob" , attributes [1 ].Value )
593593
594594 // succeed to execute store2 with mary
595- resp = exec (t , cache , checksum , "mary" , store2 , api , querier , 0xf0c3 )
595+ resp = exec (t , cache , checksum , "mary" , store2 , api , querier , 0xf749 )
596596 require .Equal (t , "" , resp .Err )
597597 require .Equal (t , 1 , len (resp .Ok .Messages ))
598598 attributes = resp .Ok .Attributes
0 commit comments