Skip to content

Commit 956daaa

Browse files
committed
Fix tests
1 parent ff1eb7c commit 956daaa

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

internal/api/lib_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func TestInstantiate(t *testing.T) {
405405
res, cost, err := Instantiate(cache, checksum, env, info, msg, &igasMeter, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG)
406406
require.NoError(t, err)
407407
requireOkResponse(t, res, 0)
408-
assert.Equal(t, uint64(0x982d3f), cost.UsedInternally)
408+
assert.Equal(t, uint64(0xb98719), cost.UsedInternally)
409409

410410
var result types.ContractResult
411411
err = json.Unmarshal(res, &result)
@@ -436,7 +436,7 @@ func TestExecute(t *testing.T) {
436436
diff := time.Since(start)
437437
require.NoError(t, err)
438438
requireOkResponse(t, res, 0)
439-
assert.Equal(t, uint64(0x982d3f), cost.UsedInternally)
439+
assert.Equal(t, uint64(0xb98719), cost.UsedInternally)
440440
t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff)
441441

442442
// execute with the same store
@@ -449,7 +449,7 @@ func TestExecute(t *testing.T) {
449449
res, cost, err = Execute(cache, checksum, env, info, []byte(`{"release":{}}`), &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG)
450450
diff = time.Since(start)
451451
require.NoError(t, err)
452-
assert.Equal(t, uint64(0x1061d27), cost.UsedInternally)
452+
assert.Equal(t, uint64(0x14439b3), cost.UsedInternally)
453453
t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff)
454454

455455
// make sure it read the balance properly and we got 250 atoms
@@ -557,7 +557,7 @@ func TestExecuteCpuLoop(t *testing.T) {
557557
diff := time.Since(start)
558558
require.NoError(t, err)
559559
requireOkResponse(t, res, 0)
560-
assert.Equal(t, uint64(0x64fb31), cost.UsedInternally)
560+
assert.Equal(t, uint64(0x79f527), cost.UsedInternally)
561561
t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff)
562562

563563
// execute a cpu loop
@@ -786,7 +786,7 @@ func TestMultipleInstances(t *testing.T) {
786786
require.NoError(t, err)
787787
requireOkResponse(t, res, 0)
788788
// we now count wasm gas charges and db writes
789-
assert.Equal(t, uint64(0x972435), cost.UsedInternally)
789+
assert.Equal(t, uint64(0xb84502), cost.UsedInternally)
790790

791791
// instance2 controlled by mary
792792
gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT)
@@ -797,14 +797,14 @@ func TestMultipleInstances(t *testing.T) {
797797
res, cost, err = Instantiate(cache, checksum, env, info, msg, &igasMeter2, store2, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG)
798798
require.NoError(t, err)
799799
requireOkResponse(t, res, 0)
800-
assert.Equal(t, uint64(0x97bfa3), cost.UsedInternally)
800+
assert.Equal(t, uint64(0xb8ffe2), cost.UsedInternally)
801801

802802
// fail to execute store1 with mary
803-
resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x8b7a9a)
803+
resp := exec(t, cache, checksum, "mary", store1, api, querier, 0xa73767)
804804
require.Equal(t, "Unauthorized", resp.Err)
805805

806806
// succeed to execute store1 with fred
807-
resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x105a4c3)
807+
resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x143b5a1)
808808
require.Equal(t, "", resp.Err)
809809
require.Equal(t, 1, len(resp.Ok.Messages))
810810
attributes := resp.Ok.Attributes
@@ -813,7 +813,7 @@ func TestMultipleInstances(t *testing.T) {
813813
require.Equal(t, "bob", attributes[1].Value)
814814

815815
// succeed to execute store2 with mary
816-
resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x105e0f5)
816+
resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x143f7aa)
817817
require.Equal(t, "", resp.Err)
818818
require.Equal(t, 1, len(resp.Ok.Messages))
819819
attributes = resp.Ok.Attributes

libwasmvm/src/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ mod tests {
944944
assert_eq!(elements_memory_cache, 0);
945945
assert_approx_eq!(
946946
size_pinned_memory_cache,
947-
2282344,
947+
2500000,
948948
"0.2",
949949
"size_pinned_memory_cache: {size_pinned_memory_cache}"
950950
);

0 commit comments

Comments
 (0)