Merge pull request #254 from gustavohmsilva/master
Closes #10 Implemented files called general_consts.go to all modules that heavly relied on the duplicated "ClientID : 1"
This commit is contained in:
@@ -183,7 +183,7 @@ type WasmApp struct {
|
|||||||
// WasmWrapper allows us to use namespacing in the config file
|
// WasmWrapper allows us to use namespacing in the config file
|
||||||
// This is only used for parsing in the app, x/wasm expects WasmConfig
|
// This is only used for parsing in the app, x/wasm expects WasmConfig
|
||||||
type WasmWrapper struct {
|
type WasmWrapper struct {
|
||||||
Wasm wasm.WasmConfig `mapstructure:"wasm"`
|
Wasm wasm.Config `mapstructure:"wasm"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewWasmApp returns a reference to an initialized WasmApp.
|
// NewWasmApp returns a reference to an initialized WasmApp.
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const firstCodeID = 1
|
||||||
|
|
||||||
func TestWasmStoreCode(t *testing.T) {
|
func TestWasmStoreCode(t *testing.T) {
|
||||||
kb, err := newKeybase()
|
kb, err := newKeybase()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -73,7 +75,6 @@ func TestWasmStoreCode(t *testing.T) {
|
|||||||
require.Len(t, listPayload.Result, 1)
|
require.Len(t, listPayload.Result, 1)
|
||||||
|
|
||||||
// and check detail view
|
// and check detail view
|
||||||
codeID := "1"
|
resp, body = Request(t, port, "GET", fmt.Sprintf("/wasm/code/%d", firstCodeID), nil)
|
||||||
resp, body = Request(t, port, "GET", fmt.Sprintf("/wasm/code/%s", codeID), nil)
|
|
||||||
require.Equal(t, http.StatusOK, resp.StatusCode, body)
|
require.Equal(t, http.StatusOK, resp.StatusCode, body)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
firstCodeID = 1
|
||||||
DefaultParamspace = types.DefaultParamspace
|
DefaultParamspace = types.DefaultParamspace
|
||||||
ModuleName = types.ModuleName
|
ModuleName = types.ModuleName
|
||||||
StoreKey = types.StoreKey
|
StoreKey = types.StoreKey
|
||||||
@@ -112,7 +113,7 @@ type (
|
|||||||
CodeInfo = types.CodeInfo
|
CodeInfo = types.CodeInfo
|
||||||
ContractInfo = types.ContractInfo
|
ContractInfo = types.ContractInfo
|
||||||
CreatedAt = types.AbsoluteTxPosition
|
CreatedAt = types.AbsoluteTxPosition
|
||||||
WasmConfig = types.WasmConfig
|
Config = types.WasmConfig
|
||||||
MessageHandler = keeper.MessageHandler
|
MessageHandler = keeper.MessageHandler
|
||||||
BankEncoder = keeper.BankEncoder
|
BankEncoder = keeper.BankEncoder
|
||||||
CustomEncoder = keeper.CustomEncoder
|
CustomEncoder = keeper.CustomEncoder
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ func TestInitGenesis(t *testing.T) {
|
|||||||
|
|
||||||
initCmd := MsgInstantiateContract{
|
initCmd := MsgInstantiateContract{
|
||||||
Sender: creator,
|
Sender: creator,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
InitMsg: initMsgBz,
|
InitMsg: initMsgBz,
|
||||||
InitFunds: deposit,
|
InitFunds: deposit,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import (
|
|||||||
dbm "github.com/tendermint/tm-db"
|
dbm "github.com/tendermint/tm-db"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const firstCodeID = 1
|
||||||
|
|
||||||
func TestGenesisExportImport(t *testing.T) {
|
func TestGenesisExportImport(t *testing.T) {
|
||||||
srcKeeper, srcCtx, srcStoreKeys, srcCleanup := setupKeeper(t)
|
srcKeeper, srcCtx, srcStoreKeys, srcCleanup := setupKeeper(t)
|
||||||
defer srcCleanup()
|
defer srcCleanup()
|
||||||
@@ -123,7 +125,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"happy path: code info correct": {
|
"happy path: code info correct": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -138,7 +140,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"happy path: code ids can contain gaps": {
|
"happy path: code ids can contain gaps": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}, {
|
}, {
|
||||||
@@ -161,7 +163,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}, {
|
}, {
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -176,7 +178,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"prevent code hash mismatch": {src: types.GenesisState{
|
"prevent code hash mismatch": {src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: wasmTypes.CodeInfoFixture(func(i *wasmTypes.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }),
|
CodeInfo: wasmTypes.CodeInfoFixture(func(i *wasmTypes.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }),
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -185,12 +187,12 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"prevent duplicate codeIDs": {src: types.GenesisState{
|
"prevent duplicate codeIDs": {src: types.GenesisState{
|
||||||
Codes: []types.Code{
|
Codes: []types.Code{
|
||||||
{
|
{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
},
|
},
|
||||||
@@ -200,7 +202,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"happy path: code id in info and contract do match": {
|
"happy path: code id in info and contract do match": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -221,7 +223,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"happy path: code info with two contracts": {
|
"happy path: code info with two contracts": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -256,7 +258,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"prevent duplicate contract address": {
|
"prevent duplicate contract address": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -275,7 +277,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"prevent duplicate contract model keys": {
|
"prevent duplicate contract model keys": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -323,7 +325,7 @@ func TestFailFastImport(t *testing.T) {
|
|||||||
"prevent contract id seq init value == count contracts": {
|
"prevent contract id seq init value == count contracts": {
|
||||||
src: types.GenesisState{
|
src: types.GenesisState{
|
||||||
Codes: []types.Code{{
|
Codes: []types.Code{{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
CodeInfo: myCodeInfo,
|
CodeInfo: myCodeInfo,
|
||||||
CodesBytes: wasmCode,
|
CodesBytes: wasmCode,
|
||||||
}},
|
}},
|
||||||
@@ -451,7 +453,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
|
|||||||
adminAddr, _ := sdk.AccAddressFromBech32("cosmos1h5t8zxmjr30e9dqghtlpl40f2zz5cgey6esxtn")
|
adminAddr, _ := sdk.AccAddressFromBech32("cosmos1h5t8zxmjr30e9dqghtlpl40f2zz5cgey6esxtn")
|
||||||
|
|
||||||
expContractInfo := types.ContractInfo{
|
expContractInfo := types.ContractInfo{
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Creator: contractCreatorAddr,
|
Creator: contractCreatorAddr,
|
||||||
Admin: adminAddr,
|
Admin: adminAddr,
|
||||||
Label: "ȀĴnZV芢毤",
|
Label: "ȀĴnZV芢毤",
|
||||||
@@ -461,7 +463,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
|
|||||||
|
|
||||||
expHistory := []types.ContractCodeHistoryEntry{{
|
expHistory := []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.GenesisContractCodeHistoryType,
|
Operation: types.GenesisContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Updated: types.NewAbsoluteTxPosition(ctx),
|
Updated: types.NewAbsoluteTxPosition(ctx),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ func TestIsSimulationMode(t *testing.T) {
|
|||||||
exp: true,
|
exp: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for msg, _ := range specs {
|
for msg := range specs {
|
||||||
t.Run(msg, func(t *testing.T) {
|
t.Run(msg, func(t *testing.T) {
|
||||||
//assert.Equal(t, spec.exp, isSimulationMode(spec.ctx))
|
//assert.Equal(t, spec.exp, isSimulationMode(spec.ctx))
|
||||||
})
|
})
|
||||||
@@ -994,8 +994,8 @@ func TestMigrateWithDispatchedMessage(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
expJsonEvts := string(mustMarshal(t, expEvents))
|
expJSONEvts := string(mustMarshal(t, expEvents))
|
||||||
assert.JSONEq(t, expJsonEvts, prettyEvents(t, ctx.EventManager().Events()))
|
assert.JSONEq(t, expJSONEvts, prettyEvents(t, ctx.EventManager().Events()))
|
||||||
|
|
||||||
// all persistent data cleared
|
// all persistent data cleared
|
||||||
m := keeper.QueryRaw(ctx, contractAddr, []byte("config"))
|
m := keeper.QueryRaw(ctx, contractAddr, []byte("config"))
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ func TestInstantiateProposal(t *testing.T) {
|
|||||||
otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, sdk.AddrLen)
|
otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, sdk.AddrLen)
|
||||||
)
|
)
|
||||||
src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) {
|
src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) {
|
||||||
p.CodeID = 1
|
p.CodeID = firstCodeID
|
||||||
p.RunAs = oneAddress
|
p.RunAs = oneAddress
|
||||||
p.Admin = otherAddress
|
p.Admin = otherAddress
|
||||||
p.Label = "testing"
|
p.Label = "testing"
|
||||||
@@ -179,7 +179,7 @@ func TestMigrateProposal(t *testing.T) {
|
|||||||
assert.Equal(t, "testing", cInfo.Label)
|
assert.Equal(t, "testing", cInfo.Label)
|
||||||
expHistory := []types.ContractCodeHistoryEntry{{
|
expHistory := []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.GenesisContractCodeHistoryType,
|
Operation: types.GenesisContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Updated: types.NewAbsoluteTxPosition(ctx),
|
Updated: types.NewAbsoluteTxPosition(ctx),
|
||||||
}, {
|
}, {
|
||||||
Operation: types.MigrateContractCodeHistoryType,
|
Operation: types.MigrateContractCodeHistoryType,
|
||||||
|
|||||||
@@ -237,20 +237,20 @@ func TestQueryContractHistory(t *testing.T) {
|
|||||||
"response with internal fields cleared": {
|
"response with internal fields cleared": {
|
||||||
srcHistory: []types.ContractCodeHistoryEntry{{
|
srcHistory: []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.GenesisContractCodeHistoryType,
|
Operation: types.GenesisContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Updated: types.NewAbsoluteTxPosition(ctx),
|
Updated: types.NewAbsoluteTxPosition(ctx),
|
||||||
Msg: []byte(`"init message"`),
|
Msg: []byte(`"init message"`),
|
||||||
}},
|
}},
|
||||||
expContent: []types.ContractCodeHistoryEntry{{
|
expContent: []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.GenesisContractCodeHistoryType,
|
Operation: types.GenesisContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Msg: []byte(`"init message"`),
|
Msg: []byte(`"init message"`),
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
"response with multiple entries": {
|
"response with multiple entries": {
|
||||||
srcHistory: []types.ContractCodeHistoryEntry{{
|
srcHistory: []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.InitContractCodeHistoryType,
|
Operation: types.InitContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Updated: types.NewAbsoluteTxPosition(ctx),
|
Updated: types.NewAbsoluteTxPosition(ctx),
|
||||||
Msg: []byte(`"init message"`),
|
Msg: []byte(`"init message"`),
|
||||||
}, {
|
}, {
|
||||||
@@ -266,7 +266,7 @@ func TestQueryContractHistory(t *testing.T) {
|
|||||||
}},
|
}},
|
||||||
expContent: []types.ContractCodeHistoryEntry{{
|
expContent: []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.InitContractCodeHistoryType,
|
Operation: types.InitContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Msg: []byte(`"init message"`),
|
Msg: []byte(`"init message"`),
|
||||||
}, {
|
}, {
|
||||||
Operation: types.MigrateContractCodeHistoryType,
|
Operation: types.MigrateContractCodeHistoryType,
|
||||||
@@ -282,7 +282,7 @@ func TestQueryContractHistory(t *testing.T) {
|
|||||||
srcQueryAddr: otherAddr,
|
srcQueryAddr: otherAddr,
|
||||||
srcHistory: []types.ContractCodeHistoryEntry{{
|
srcHistory: []types.ContractCodeHistoryEntry{{
|
||||||
Operation: types.GenesisContractCodeHistoryType,
|
Operation: types.GenesisContractCodeHistoryType,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Updated: types.NewAbsoluteTxPosition(ctx),
|
Updated: types.NewAbsoluteTxPosition(ctx),
|
||||||
Msg: []byte(`"init message"`),
|
Msg: []byte(`"init message"`),
|
||||||
}},
|
}},
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func FuzzStateModel(m *types.Model, c fuzz.Continue) {
|
|||||||
|
|
||||||
func FuzzAccessType(m *types.AccessType, c fuzz.Continue) {
|
func FuzzAccessType(m *types.AccessType, c fuzz.Continue) {
|
||||||
pos := c.Int() % len(types.AllAccessTypes)
|
pos := c.Int() % len(types.AllAccessTypes)
|
||||||
for k, _ := range types.AllAccessTypes {
|
for k := range types.AllAccessTypes {
|
||||||
if pos == 0 {
|
if pos == 0 {
|
||||||
*m = k
|
*m = k
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const firstCodeID = 1
|
||||||
|
|
||||||
func TestBuilderRegexp(t *testing.T) {
|
func TestBuilderRegexp(t *testing.T) {
|
||||||
cases := map[string]struct {
|
cases := map[string]struct {
|
||||||
example string
|
example string
|
||||||
@@ -146,7 +148,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"correct minimal": {
|
"correct minimal": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
InitMsg: []byte("{}"),
|
InitMsg: []byte("{}"),
|
||||||
},
|
},
|
||||||
@@ -177,7 +179,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"bad sender minimal": {
|
"bad sender minimal": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: badAddress,
|
Sender: badAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
InitMsg: []byte("{}"),
|
InitMsg: []byte("{}"),
|
||||||
},
|
},
|
||||||
@@ -186,7 +188,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"correct maximal": {
|
"correct maximal": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
InitMsg: []byte(`{"some": "data"}`),
|
InitMsg: []byte(`{"some": "data"}`),
|
||||||
InitFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
InitFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
||||||
@@ -196,7 +198,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"negative funds": {
|
"negative funds": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
InitMsg: []byte(`{"some": "data"}`),
|
InitMsg: []byte(`{"some": "data"}`),
|
||||||
// we cannot use sdk.NewCoin() constructors as they panic on creating invalid data (before we can test)
|
// we cannot use sdk.NewCoin() constructors as they panic on creating invalid data (before we can test)
|
||||||
@@ -207,7 +209,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"non json init msg": {
|
"non json init msg": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
InitMsg: []byte("invalid-json"),
|
InitMsg: []byte("invalid-json"),
|
||||||
},
|
},
|
||||||
@@ -216,7 +218,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
|||||||
"empty init msg": {
|
"empty init msg": {
|
||||||
msg: MsgInstantiateContract{
|
msg: MsgInstantiateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
Label: "foo",
|
Label: "foo",
|
||||||
},
|
},
|
||||||
valid: false,
|
valid: false,
|
||||||
@@ -479,7 +481,7 @@ func TestMsgMigrateContract(t *testing.T) {
|
|||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
Contract: anotherGoodAddress,
|
Contract: anotherGoodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
MigrateMsg: []byte("{}"),
|
MigrateMsg: []byte("{}"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -487,14 +489,14 @@ func TestMsgMigrateContract(t *testing.T) {
|
|||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: badAddress,
|
Sender: badAddress,
|
||||||
Contract: anotherGoodAddress,
|
Contract: anotherGoodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
},
|
},
|
||||||
"empty sender": {
|
"empty sender": {
|
||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Contract: anotherGoodAddress,
|
Contract: anotherGoodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
},
|
},
|
||||||
@@ -509,14 +511,14 @@ func TestMsgMigrateContract(t *testing.T) {
|
|||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
Contract: badAddress,
|
Contract: badAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
},
|
},
|
||||||
"empty contract addr": {
|
"empty contract addr": {
|
||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
},
|
},
|
||||||
@@ -524,7 +526,7 @@ func TestMsgMigrateContract(t *testing.T) {
|
|||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
Contract: anotherGoodAddress,
|
Contract: anotherGoodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
MigrateMsg: []byte("invalid json"),
|
MigrateMsg: []byte("invalid json"),
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
@@ -533,7 +535,7 @@ func TestMsgMigrateContract(t *testing.T) {
|
|||||||
src: MsgMigrateContract{
|
src: MsgMigrateContract{
|
||||||
Sender: goodAddress,
|
Sender: goodAddress,
|
||||||
Contract: anotherGoodAddress,
|
Contract: anotherGoodAddress,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
},
|
},
|
||||||
expErr: true,
|
expErr: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ func TestHandleInstantiate(t *testing.T) {
|
|||||||
// create with no balance is also legal
|
// create with no balance is also legal
|
||||||
initCmd := MsgInstantiateContract{
|
initCmd := MsgInstantiateContract{
|
||||||
Sender: creator,
|
Sender: creator,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
InitMsg: initMsgBz,
|
InitMsg: initMsgBz,
|
||||||
InitFunds: nil,
|
InitFunds: nil,
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ func TestHandleExecute(t *testing.T) {
|
|||||||
|
|
||||||
initCmd := MsgInstantiateContract{
|
initCmd := MsgInstantiateContract{
|
||||||
Sender: creator,
|
Sender: creator,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
InitMsg: initMsgBz,
|
InitMsg: initMsgBz,
|
||||||
InitFunds: deposit,
|
InitFunds: deposit,
|
||||||
}
|
}
|
||||||
@@ -339,7 +339,7 @@ func TestHandleExecuteEscrow(t *testing.T) {
|
|||||||
|
|
||||||
initCmd := MsgInstantiateContract{
|
initCmd := MsgInstantiateContract{
|
||||||
Sender: creator,
|
Sender: creator,
|
||||||
CodeID: 1,
|
CodeID: firstCodeID,
|
||||||
InitMsg: initMsgBz,
|
InitMsg: initMsgBz,
|
||||||
InitFunds: deposit,
|
InitFunds: deposit,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user