Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Bump cosmwasm to v0.9 #357

Merged
merged 8 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed app.test
Binary file not shown.
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func NewTerraApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
market.NewAppModule(app.marketKeeper, app.accountKeeper, app.oracleKeeper),
oracle.NewAppModule(app.oracleKeeper, app.accountKeeper),
treasury.NewAppModule(app.treasuryKeeper),
wasm.NewAppModule(app.wasmKeeper, app.accountKeeper),
wasm.NewAppModule(app.wasmKeeper, app.accountKeeper, app.bankKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down Expand Up @@ -307,7 +307,7 @@ func NewTerraApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
market.NewAppModule(app.marketKeeper, app.accountKeeper, app.oracleKeeper),
oracle.NewAppModule(app.oracleKeeper, app.accountKeeper),
treasury.NewAppModule(app.treasuryKeeper),
wasm.NewAppModule(app.wasmKeeper, app.accountKeeper),
wasm.NewAppModule(app.wasmKeeper, app.accountKeeper, app.bankKeeper),
)

app.sm.RegisterStoreDecoders()
Expand Down
73 changes: 72 additions & 1 deletion client/lcd/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2726,6 +2726,58 @@ paths:
description: OK
schema:
$ref: "#/definitions/ContractInfo"
/wasm/contracts/{contractAddress}/migrate:
post:
summary: Migrate wasm contract to new code base
tags:
- Wasm
produces:
- application/json
parameters:
- in: path
name: contractAddress
description: contract address you want to migrate
required: true
type: string
- in: body
name: migrate contract request body
schema:
$ref: "#/definitions/MigrateContractReq"
responses:
200:
description: OK
schema:
$ref: "#/definitions/StdTx"
400:
description: Bad request
500:
description: Internal Server Error
/wasm/contracts/{contractAddress}/owner:
post:
summary: Update wasm contract owner to new address
tags:
- Wasm
produces:
- application/json
parameters:
- in: path
name: contractAddress
description: contract address you want to update owner
required: true
type: string
- in: body
name: update contract owner request body
schema:
$ref: "#/definitions/UpdateContractOwnerReq"
responses:
200:
description: OK
schema:
$ref: "#/definitions/StdTx"
400:
description: Bad request
500:
description: Internal Server Error
/wasm/contracts/{contractAddress}/store:
get:
summary: Get stored information with query msg
Expand Down Expand Up @@ -3834,7 +3886,6 @@ definitions:
type: string
description: json formatted string
example: "{}"

ExecuteContractReq:
type: object
properties:
Expand All @@ -3846,5 +3897,25 @@ definitions:
$ref: "#/definitions/Coin"
exec_msg:
type: string
example: "{}"
MigrateContractReq:
type: object
properties:
base_req:
$ref: "#/definitions/BaseReq"
new_code_id:
type: number
format: integer
example: 10
migrate_msg:
type: string
example: "{}"
UpdateContractOwnerReq:
type: object
properties:
base_req:
$ref: "#/definitions/BaseReq"
new_owner:
$ref: "#/definitions/Address"
description: json formatted string
example: "{}"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/terra-project/core
go 1.13

require (
github.com/CosmWasm/go-cosmwasm v0.8.0
github.com/CosmWasm/go-cosmwasm v0.9.1
github.com/cosmos/cosmos-sdk v0.38.4
github.com/gorilla/mux v1.7.3
github.com/otiai10/copy v1.0.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f h1:4O1om+UVU+Hfcihr1timk8YNXHxzZWgCo7ofnrZRApw=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/go-cosmwasm v0.8.0 h1:xoufklhgJQ7Sy6xwZw9hRbnXl79ylvxlpGJDcPz9Ipo=
github.com/CosmWasm/go-cosmwasm v0.8.0/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc=
github.com/CosmWasm/go-cosmwasm v0.9.1 h1:w5s2o7H3cmNexct9yv8F6OLXwgxbdfVApwam7DibPqI=
github.com/CosmWasm/go-cosmwasm v0.9.1/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/tax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func TestEnsureMempoolFeesInstantiateContract(t *testing.T) {

sendAmount := int64(1000000)
sendCoins := sdk.NewCoins(sdk.NewInt64Coin(core.MicroSDRDenom, sendAmount))
msgs := []sdk.Msg{wasm.NewMsgInstantiateContract(addr1, 0, []byte{}, sendCoins)}
msgs := []sdk.Msg{wasm.NewMsgInstantiateContract(addr1, 0, []byte{}, sendCoins, true)}

fee := auth.NewStdFee(100000, sdk.NewCoins())
tx := types.NewTestTx(ctx, msgs, privs, accNums, seqs, fee)
Expand Down
12 changes: 9 additions & 3 deletions x/wasm/alias.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// nolint
// autogenerated code using github.com/rigelrozanski/multitool
// aliases generated for the following subdirectories:
// ALIASGEN: core/x/wasm/internal/keeper
// ALIASGEN: core/x/wasm/internal/types
// ALIASGEN: github.com/terra-project/core/x/wasm/internal/keeper
// ALIASGEN: github.com/terra-project/core/x/wasm/internal/types
package wasm

import (
Expand Down Expand Up @@ -48,7 +48,7 @@ var (
NewWasmMsgParser = keeper.NewWasmMsgParser
NewWasmQuerier = keeper.NewWasmQuerier
RegisterCodec = types.RegisterCodec
ParseResult = types.ParseResult
ParseEvents = types.ParseEvents
ParseToCoin = types.ParseToCoin
ParseToCoins = types.ParseToCoins
EncodeSdkCoin = types.EncodeSdkCoin
Expand All @@ -66,6 +66,8 @@ var (
NewMsgStoreCode = types.NewMsgStoreCode
NewMsgInstantiateContract = types.NewMsgInstantiateContract
NewMsgExecuteContract = types.NewMsgExecuteContract
NewMsgMigrateContract = types.NewMsgMigrateContract
NewMsgUpdateContractOwner = types.NewMsgUpdateContractOwner
NewModuleMsgParser = types.NewModuleMsgParser
DefaultParams = types.DefaultParams
ParamKeyTable = types.ParamKeyTable
Expand All @@ -87,6 +89,8 @@ var (
ErrInvalidMsg = types.ErrInvalidMsg
ErrNoRegisteredQuerier = types.ErrNoRegisteredQuerier
ErrNoRegisteredParser = types.ErrNoRegisteredParser
ErrMigrationFailed = types.ErrMigrationFailed
ErrNotMigratable = types.ErrNotMigratable
LastCodeIDKey = types.LastCodeIDKey
LastInstanceIDKey = types.LastInstanceIDKey
CodeKey = types.CodeKey
Expand Down Expand Up @@ -114,6 +118,8 @@ type (
MsgStoreCode = types.MsgStoreCode
MsgInstantiateContract = types.MsgInstantiateContract
MsgExecuteContract = types.MsgExecuteContract
MsgMigrateContract = types.MsgMigrateContract
MsgUpdateContractOwner = types.MsgUpdateContractOwner
WasmMsgParserInterface = types.WasmMsgParserInterface
WasmCustomMsg = types.WasmCustomMsg
MsgParser = types.MsgParser
Expand Down
Loading