diff --git a/internal/api/lib_test.go b/internal/api/lib_test.go index f7b4404f9..e3f042037 100644 --- a/internal/api/lib_test.go +++ b/internal/api/lib_test.go @@ -485,7 +485,7 @@ func TestInstantiate(t *testing.T) { res, cost, err := Instantiate(cache, checksum, env, info, msg, &igasMeter, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x8c288c), cost.UsedInternally) + assert.Equal(t, uint64(0xb1fe27), cost.UsedInternally) var result types.ContractResult err = json.Unmarshal(res, &result) @@ -516,7 +516,7 @@ func TestExecute(t *testing.T) { diff := time.Since(start) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x8c288c), cost.UsedInternally) + assert.Equal(t, uint64(0xb1fe27), cost.UsedInternally) t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff) // execute with the same store @@ -529,7 +529,7 @@ func TestExecute(t *testing.T) { res, cost, err = Execute(cache, checksum, env, info, []byte(`{"release":{}}`), &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) diff = time.Since(start) require.NoError(t, err) - assert.Equal(t, uint64(0xfaea3d), cost.UsedInternally) + assert.Equal(t, uint64(0x1416da5), cost.UsedInternally) t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff) // make sure it read the balance properly and we got 250 atoms @@ -637,7 +637,7 @@ func TestExecuteCpuLoop(t *testing.T) { diff := time.Since(start) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x64fb31), cost.UsedInternally) + assert.Equal(t, uint64(0x79f527), cost.UsedInternally) t.Logf("Time (%d gas): %s\n", cost.UsedInternally, diff) // execute a cpu loop @@ -866,7 +866,7 @@ func TestMultipleInstances(t *testing.T) { require.NoError(t, err) requireOkResponse(t, res, 0) // we now count wasm gas charges and db writes - assert.Equal(t, uint64(0x8b0ca4), cost.UsedInternally) + assert.Equal(t, uint64(0xb0c2cd), cost.UsedInternally) // instance2 controlled by mary gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT) @@ -877,14 +877,14 @@ func TestMultipleInstances(t *testing.T) { res, cost, err = Instantiate(cache, checksum, env, info, msg, &igasMeter2, store2, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG) require.NoError(t, err) requireOkResponse(t, res, 0) - assert.Equal(t, uint64(0x8baa51), cost.UsedInternally) + assert.Equal(t, uint64(0xb1760a), cost.UsedInternally) // fail to execute store1 with mary - resp := exec(t, cache, checksum, "mary", store1, api, querier, 0x85e616) + resp := exec(t, cache, checksum, "mary", store1, api, querier, 0xa7c5ce) require.Equal(t, "Unauthorized", resp.Err) // succeed to execute store1 with fred - resp = exec(t, cache, checksum, "fred", store1, api, querier, 0xfa70f3) + resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x140e8ad) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes := resp.Ok.Attributes @@ -893,7 +893,7 @@ func TestMultipleInstances(t *testing.T) { require.Equal(t, "bob", attributes[1].Value) // succeed to execute store2 with mary - resp = exec(t, cache, checksum, "mary", store2, api, querier, 0xfaad98) + resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x1412b29) require.Equal(t, "", resp.Err) require.Equal(t, 1, len(resp.Ok.Messages)) attributes = resp.Ok.Attributes