Skip to content

Commit

Permalink
Merge pull request #158 from CosmWasm/update-to-0.12.0
Browse files Browse the repository at this point in the history
Update to 0.12.0
  • Loading branch information
webmaster128 authored Nov 19, 2020
2 parents 01d827f + 21f2c6b commit 9e5b7c4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmvm"
version = "0.12.0-alpha3"
version = "0.12.0"
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>"]
edition = "2018"
description = "Go bindings for cosmwasm contracts"
Expand Down Expand Up @@ -32,8 +32,8 @@ singlepass = ["cosmwasm-vm/default-singlepass"]
cranelift = ["cosmwasm-vm/default-cranelift"]

[dependencies]
cosmwasm-std = { version = "0.12.0-alpha3", features = ["iterator"]}
cosmwasm-vm = { version = "0.12.0-alpha3", features = ["iterator"] }
cosmwasm-std = { version = "0.12.0", features = ["iterator"]}
cosmwasm-vm = { version = "0.12.0", features = ["iterator"] }
errno = "0.2"
serde_json = "1.0"
thiserror = "1.0"
Expand Down
18 changes: 9 additions & 9 deletions api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestInstantiate(t *testing.T) {
res, cost, err := Instantiate(cache, id, 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(0x113ae), cost)
assert.Equal(t, uint64(0x13860), cost)

var resp types.InitResult
err = json.Unmarshal(res, &resp)
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestHandle(t *testing.T) {
diff := time.Now().Sub(start)
require.NoError(t, err)
requireOkResponse(t, res, 0)
assert.Equal(t, uint64(0x113ae), cost)
assert.Equal(t, uint64(0x13860), cost)
t.Logf("Time (%d gas): %s\n", 0xbb66, diff)

// execute with the same store
Expand All @@ -136,7 +136,7 @@ func TestHandle(t *testing.T) {
res, cost, err = Handle(cache, id, env, info, []byte(`{"release":{}}`), &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG)
diff = time.Now().Sub(start)
require.NoError(t, err)
assert.Equal(t, uint64(0x1a021), cost)
assert.Equal(t, uint64(0x1d663), cost)
t.Logf("Time (%d gas): %s\n", cost, diff)

// make sure it read the balance properly and we got 250 atoms
Expand Down Expand Up @@ -179,7 +179,7 @@ func TestHandleCpuLoop(t *testing.T) {
diff := time.Now().Sub(start)
require.NoError(t, err)
requireOkResponse(t, res, 0)
assert.Equal(t, uint64(0x113ae), cost)
assert.Equal(t, uint64(0x13860), cost)
t.Logf("Time (%d gas): %s\n", 0xbb66, diff)

// execute a cpu loop
Expand Down Expand Up @@ -331,7 +331,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(0x112e8), cost)
assert.Equal(t, uint64(0x13762), cost)

// instance2 controlled by mary
gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT)
Expand All @@ -342,14 +342,14 @@ func TestMultipleInstances(t *testing.T) {
res, cost, err = Instantiate(cache, id, 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(0x1134b), cost)
assert.Equal(t, uint64(0x137e1), cost)

// fail to execute store1 with mary
resp := exec(t, cache, id, "mary", store1, api, querier, 0xf703)
resp := exec(t, cache, id, "mary", store1, api, querier, 0x11574)
require.Equal(t, "Unauthorized", resp.Err)

// succeed to execute store1 with fred
resp = exec(t, cache, id, "fred", store1, api, querier, 0x1a021)
resp = exec(t, cache, id, "fred", store1, api, querier, 0x1d663)
require.Equal(t, "", resp.Err)
require.Equal(t, 1, len(resp.Ok.Messages))
attributes := resp.Ok.Attributes
Expand All @@ -358,7 +358,7 @@ func TestMultipleInstances(t *testing.T) {
require.Equal(t, "bob", attributes[1].Value)

// succeed to execute store2 with mary
resp = exec(t, cache, id, "mary", store2, api, querier, 0x1a021)
resp = exec(t, cache, id, "mary", store2, api, querier, 0x1d663)
require.Equal(t, "", resp.Err)
require.Equal(t, 1, len(resp.Ok.Messages))
attributes = resp.Ok.Attributes
Expand Down
Binary file modified api/testdata/hackatom.wasm
Binary file not shown.
Binary file modified api/testdata/queue.wasm
Binary file not shown.
Binary file modified api/testdata/reflect.wasm
Binary file not shown.

0 comments on commit 9e5b7c4

Please sign in to comment.