@@ -305,7 +305,7 @@ func TestGetMetrics(t *testing.T) {
305
305
require .Equal (t , uint32 (0 ), metrics .HitsMemoryCache )
306
306
require .Equal (t , uint32 (1 ), metrics .HitsFsCache )
307
307
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
308
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
308
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
309
309
310
310
// Instantiate 2
311
311
msg2 := []byte (`{"verifier": "fred", "beneficiary": "susi"}` )
@@ -318,7 +318,7 @@ func TestGetMetrics(t *testing.T) {
318
318
require .Equal (t , uint32 (1 ), metrics .HitsMemoryCache )
319
319
require .Equal (t , uint32 (1 ), metrics .HitsFsCache )
320
320
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
321
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
321
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
322
322
323
323
// Pin
324
324
err = Pin (cache , checksum )
@@ -331,8 +331,8 @@ func TestGetMetrics(t *testing.T) {
331
331
require .Equal (t , uint32 (2 ), metrics .HitsFsCache )
332
332
require .Equal (t , uint64 (1 ), metrics .ElementsPinnedMemoryCache )
333
333
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
334
- require .InEpsilon (t , 2832576 , metrics .SizePinnedMemoryCache , 0.25 )
335
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
334
+ require .InEpsilon (t , 3700000 , metrics .SizePinnedMemoryCache , 0.25 )
335
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
336
336
337
337
// Instantiate 3
338
338
msg3 := []byte (`{"verifier": "fred", "beneficiary": "bert"}` )
@@ -347,8 +347,8 @@ func TestGetMetrics(t *testing.T) {
347
347
require .Equal (t , uint32 (2 ), metrics .HitsFsCache )
348
348
require .Equal (t , uint64 (1 ), metrics .ElementsPinnedMemoryCache )
349
349
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
350
- require .InEpsilon (t , 2832576 , metrics .SizePinnedMemoryCache , 0.25 )
351
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
350
+ require .InEpsilon (t , 3700000 , metrics .SizePinnedMemoryCache , 0.25 )
351
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
352
352
353
353
// Unpin
354
354
err = Unpin (cache , checksum )
@@ -363,7 +363,7 @@ func TestGetMetrics(t *testing.T) {
363
363
require .Equal (t , uint64 (0 ), metrics .ElementsPinnedMemoryCache )
364
364
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
365
365
require .Equal (t , uint64 (0 ), metrics .SizePinnedMemoryCache )
366
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
366
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
367
367
368
368
// Instantiate 4
369
369
msg4 := []byte (`{"verifier": "fred", "beneficiary": "jeff"}` )
@@ -379,7 +379,7 @@ func TestGetMetrics(t *testing.T) {
379
379
require .Equal (t , uint64 (0 ), metrics .ElementsPinnedMemoryCache )
380
380
require .Equal (t , uint64 (1 ), metrics .ElementsMemoryCache )
381
381
require .Equal (t , uint64 (0 ), metrics .SizePinnedMemoryCache )
382
- require .InEpsilon (t , 2832576 , metrics .SizeMemoryCache , 0.25 )
382
+ require .InEpsilon (t , 3700000 , metrics .SizeMemoryCache , 0.25 )
383
383
}
384
384
385
385
func TestInstantiate (t * testing.T ) {
@@ -405,7 +405,7 @@ func TestInstantiate(t *testing.T) {
405
405
res , cost , err := Instantiate (cache , checksum , env , info , msg , & igasMeter , store , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
406
406
require .NoError (t , err )
407
407
requireOkResponse (t , res , 0 )
408
- assert .Equal (t , uint64 (0x5088ea ), cost .UsedInternally )
408
+ assert .Equal (t , uint64 (0x540eb6 ), cost .UsedInternally )
409
409
410
410
var result types.ContractResult
411
411
err = json .Unmarshal (res , & result )
@@ -436,7 +436,7 @@ func TestExecute(t *testing.T) {
436
436
diff := time .Since (start )
437
437
require .NoError (t , err )
438
438
requireOkResponse (t , res , 0 )
439
- assert .Equal (t , uint64 (0x5088ea ), cost .UsedInternally )
439
+ assert .Equal (t , uint64 (0x540eb6 ), cost .UsedInternally )
440
440
t .Logf ("Time (%d gas): %s\n " , cost .UsedInternally , diff )
441
441
442
442
// execute with the same store
@@ -449,7 +449,7 @@ func TestExecute(t *testing.T) {
449
449
res , cost , err = Execute (cache , checksum , env , info , []byte (`{"release":{}}` ), & igasMeter2 , store , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
450
450
diff = time .Since (start )
451
451
require .NoError (t , err )
452
- assert .Equal (t , uint64 (0x8be9c6 ), cost .UsedInternally )
452
+ assert .Equal (t , uint64 (0x975216 ), cost .UsedInternally )
453
453
t .Logf ("Time (%d gas): %s\n " , cost .UsedInternally , diff )
454
454
455
455
// make sure it read the balance properly and we got 250 atoms
@@ -557,7 +557,7 @@ func TestExecuteCpuLoop(t *testing.T) {
557
557
diff := time .Since (start )
558
558
require .NoError (t , err )
559
559
requireOkResponse (t , res , 0 )
560
- assert .Equal (t , uint64 (0x365a42 ), cost .UsedInternally )
560
+ assert .Equal (t , uint64 (0x3d997e ), cost .UsedInternally )
561
561
t .Logf ("Time (%d gas): %s\n " , cost .UsedInternally , diff )
562
562
563
563
// execute a cpu loop
@@ -786,7 +786,7 @@ func TestMultipleInstances(t *testing.T) {
786
786
require .NoError (t , err )
787
787
requireOkResponse (t , res , 0 )
788
788
// we now count wasm gas charges and db writes
789
- assert .Equal (t , uint64 (0x4ffce0 ), cost .UsedInternally )
789
+ assert .Equal (t , uint64 (0x53541c ), cost .UsedInternally )
790
790
791
791
// instance2 controlled by mary
792
792
gasMeter2 := NewMockGasMeter (TESTING_GAS_LIMIT )
@@ -797,14 +797,14 @@ func TestMultipleInstances(t *testing.T) {
797
797
res , cost , err = Instantiate (cache , checksum , env , info , msg , & igasMeter2 , store2 , api , & querier , TESTING_GAS_LIMIT , TESTING_PRINT_DEBUG )
798
798
require .NoError (t , err )
799
799
requireOkResponse (t , res , 0 )
800
- assert .Equal (t , uint64 (0x504dbc ), cost .UsedInternally )
800
+ assert .Equal (t , uint64 (0x53bbb4 ), cost .UsedInternally )
801
801
802
802
// fail to execute store1 with mary
803
- resp := exec (t , cache , checksum , "mary" , store1 , api , querier , 0x4a20c2 )
803
+ resp := exec (t , cache , checksum , "mary" , store1 , api , querier , 0x503f70 )
804
804
require .Equal (t , "Unauthorized" , resp .Err )
805
805
806
806
// succeed to execute store1 with fred
807
- resp = exec (t , cache , checksum , "fred" , store1 , api , querier , 0x8ba826 )
807
+ resp = exec (t , cache , checksum , "fred" , store1 , api , querier , 0x970662 )
808
808
require .Equal (t , "" , resp .Err )
809
809
require .Equal (t , 1 , len (resp .Ok .Messages ))
810
810
attributes := resp .Ok .Attributes
@@ -813,7 +813,7 @@ func TestMultipleInstances(t *testing.T) {
813
813
require .Equal (t , "bob" , attributes [1 ].Value )
814
814
815
815
// succeed to execute store2 with mary
816
- resp = exec (t , cache , checksum , "mary" , store2 , api , querier , 0x8bc8f6 )
816
+ resp = exec (t , cache , checksum , "mary" , store2 , api , querier , 0x972c3c )
817
817
require .Equal (t , "" , resp .Err )
818
818
require .Equal (t , 1 , len (resp .Ok .Messages ))
819
819
attributes = resp .Ok .Attributes
0 commit comments