Skip to content

Commit 3a16ee7

Browse files
committed
Use hackatom with migrate_version
1 parent 7b8338b commit 3a16ee7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ibc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func TestAnalyzeCode(t *testing.T) {
302302
require.NoError(t, err)
303303
require.False(t, report.HasIBCEntryPoints)
304304
require.Equal(t, "", report.RequiredCapabilities)
305-
require.Nil(t, report.ContractMigrateVersion)
305+
require.Equal(t, uint64(42), *report.ContractMigrateVersion)
306306

307307
// Store IBC contract
308308
wasm2, err := os.ReadFile(IBC_TEST_CONTRACT)

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(0x5088ea), cost.UsedInternally)
408+
assert.Equal(t, uint64(0x540eb6), 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(0x5088ea), cost.UsedInternally)
439+
assert.Equal(t, uint64(0x540eb6), 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(0x8be9c6), cost.UsedInternally)
452+
assert.Equal(t, uint64(0x975216), 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(0x365a42), cost.UsedInternally)
560+
assert.Equal(t, uint64(0x3d997e), 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(0x4ffce0), cost.UsedInternally)
789+
assert.Equal(t, uint64(0x53541c), 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(0x504dbc), cost.UsedInternally)
800+
assert.Equal(t, uint64(0x53bbb4), cost.UsedInternally)
801801

802802
// 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)
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, 0x8ba826)
807+
resp = exec(t, cache, checksum, "fred", store1, api, querier, 0x970662)
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, 0x8bc8f6)
816+
resp = exec(t, cache, checksum, "mary", store2, api, querier, 0x972c3c)
817817
require.Equal(t, "", resp.Err)
818818
require.Equal(t, 1, len(resp.Ok.Messages))
819819
attributes = resp.Ok.Attributes

testdata/hackatom.wasm

53.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)