Rename to funds in msgs
This commit is contained in:
@@ -267,7 +267,7 @@ InstantiateContractProposal gov proposal content type to instantiate a contract.
|
||||
| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
|
||||
| label | [string](#string) | | Label is optional metadata to be stored with a constract instance. |
|
||||
| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation |
|
||||
| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation |
|
||||
| funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
|
||||
|
||||
|
||||
|
||||
@@ -705,7 +705,7 @@ MsgExecuteContract submits the given message data to a smart contract
|
||||
| sender | [string](#string) | | Sender is the that actor that signed the messages |
|
||||
| contract | [string](#string) | | Contract is the address of the smart contract |
|
||||
| msg | [bytes](#bytes) | | Msg json encoded message to be passed to the contract |
|
||||
| sent_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | SentFunds coins that are transferred to the contract on execution |
|
||||
| funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on execution |
|
||||
|
||||
|
||||
|
||||
@@ -740,7 +740,7 @@ MsgInstantiateContract create a new smart contract instance for the given code i
|
||||
| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
|
||||
| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
|
||||
| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation |
|
||||
| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation |
|
||||
| funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ func GenesisInstantiateContractCmd(defaultNodeHome string) *cobra.Command {
|
||||
|
||||
return alterModuleState(cmd, func(state *types.GenesisState, appState map[string]json.RawMessage) error {
|
||||
// simple sanity check that sender has some balance although it may be consumed by appState previous message already
|
||||
switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.InitFunds); {
|
||||
switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.Funds); {
|
||||
case err != nil:
|
||||
return err
|
||||
case !ok:
|
||||
@@ -155,7 +155,7 @@ func GenesisExecuteContractCmd(defaultNodeHome string) *cobra.Command {
|
||||
|
||||
return alterModuleState(cmd, func(state *types.GenesisState, appState map[string]json.RawMessage) error {
|
||||
// simple sanity check that sender has some balance although it may be consumed by appState previous message already
|
||||
switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.SentFunds); {
|
||||
switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.Funds); {
|
||||
case err != nil:
|
||||
return err
|
||||
case !ok:
|
||||
|
||||
@@ -216,7 +216,7 @@ func TestInstantiateContractCmd(t *testing.T) {
|
||||
},
|
||||
expError: true,
|
||||
},
|
||||
"succeeds with unknown account when no init_funds": {
|
||||
"succeeds with unknown account when no funds": {
|
||||
srcGenesis: types.GenesisState{
|
||||
Params: types.DefaultParams(),
|
||||
Codes: []types.Code{
|
||||
@@ -411,7 +411,7 @@ func TestExecuteContractCmd(t *testing.T) {
|
||||
},
|
||||
expError: true,
|
||||
},
|
||||
"succeeds with unknown account when no sent_funds": {
|
||||
"succeeds with unknown account when no funds": {
|
||||
srcGenesis: types.GenesisState{
|
||||
Params: types.DefaultParams(),
|
||||
Codes: []types.Code{
|
||||
|
||||
@@ -138,7 +138,7 @@ func ProposalInstantiateContractCmd() *cobra.Command {
|
||||
CodeID: src.CodeID,
|
||||
Label: src.Label,
|
||||
InitMsg: src.InitMsg,
|
||||
InitFunds: src.InitFunds,
|
||||
Funds: src.Funds,
|
||||
}
|
||||
|
||||
msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
|
||||
|
||||
@@ -198,12 +198,12 @@ func parseInstantiateArgs(rawCodeID, initMsg string, sender sdk.AccAddress, flag
|
||||
|
||||
// build and sign the transaction, then broadcast to Tendermint
|
||||
msg := types.MsgInstantiateContract{
|
||||
Sender: sender.String(),
|
||||
CodeID: codeID,
|
||||
Label: label,
|
||||
InitFunds: amount,
|
||||
InitMsg: []byte(initMsg),
|
||||
Admin: adminStr,
|
||||
Sender: sender.String(),
|
||||
CodeID: codeID,
|
||||
Label: label,
|
||||
Funds: amount,
|
||||
InitMsg: []byte(initMsg),
|
||||
Admin: adminStr,
|
||||
}
|
||||
return msg, nil
|
||||
}
|
||||
@@ -245,9 +245,9 @@ func parseExecuteArgs(contractAddr string, execMsg string, sender sdk.AccAddress
|
||||
}
|
||||
|
||||
return types.MsgExecuteContract{
|
||||
Sender: sender.String(),
|
||||
Contract: contractAddr,
|
||||
SentFunds: amount,
|
||||
Msg: []byte(execMsg),
|
||||
Sender: sender.String(),
|
||||
Contract: contractAddr,
|
||||
Funds: amount,
|
||||
Msg: []byte(execMsg),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ func TestGovRestHandlers(t *testing.T) {
|
||||
"code_id": "1",
|
||||
"label": "https://example.com/",
|
||||
"init_msg": "my/builder:tag",
|
||||
"init_funds": []dict{{"denom": "ustake", "amount": "100"}},
|
||||
"funds": []dict{{"denom": "ustake", "amount": "100"}},
|
||||
"deposit": []dict{{"denom": "ustake", "amount": "10"}},
|
||||
"proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
|
||||
"base_req": aBaseReq,
|
||||
|
||||
@@ -77,11 +77,11 @@ type InstantiateProposalJsonReq struct {
|
||||
|
||||
RunAs string `json:"run_as" yaml:"run_as"`
|
||||
// Admin is an optional address that can execute migrations
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
Code uint64 `json:"code_id" yaml:"code_id"`
|
||||
Label string `json:"label" yaml:"label"`
|
||||
InitMsg json.RawMessage `json:"init_msg" yaml:"init_msg"`
|
||||
InitFunds sdk.Coins `json:"init_funds" yaml:"init_funds"`
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
Code uint64 `json:"code_id" yaml:"code_id"`
|
||||
Label string `json:"label" yaml:"label"`
|
||||
InitMsg json.RawMessage `json:"init_msg" yaml:"init_msg"`
|
||||
Funds sdk.Coins `json:"funds" yaml:"funds"`
|
||||
}
|
||||
|
||||
func (s InstantiateProposalJsonReq) Content() govtypes.Content {
|
||||
@@ -93,7 +93,7 @@ func (s InstantiateProposalJsonReq) Content() govtypes.Content {
|
||||
CodeID: s.Code,
|
||||
Label: s.Label,
|
||||
InitMsg: s.InitMsg,
|
||||
InitFunds: s.InitFunds,
|
||||
Funds: s.Funds,
|
||||
}
|
||||
}
|
||||
func (s InstantiateProposalJsonReq) GetProposer() string {
|
||||
|
||||
@@ -101,12 +101,12 @@ func instantiateContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
|
||||
}
|
||||
|
||||
msg := types.MsgInstantiateContract{
|
||||
Sender: req.BaseReq.From,
|
||||
CodeID: codeID,
|
||||
Label: req.Label,
|
||||
InitFunds: req.Deposit,
|
||||
InitMsg: req.InitMsg,
|
||||
Admin: req.Admin,
|
||||
Sender: req.BaseReq.From,
|
||||
CodeID: codeID,
|
||||
Label: req.Label,
|
||||
Funds: req.Deposit,
|
||||
InitMsg: req.InitMsg,
|
||||
Admin: req.Admin,
|
||||
}
|
||||
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
@@ -133,10 +133,10 @@ func executeContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
|
||||
}
|
||||
|
||||
msg := types.MsgExecuteContract{
|
||||
Sender: req.BaseReq.From,
|
||||
Contract: contractAddr,
|
||||
Msg: req.ExecMsg,
|
||||
SentFunds: req.Amount,
|
||||
Sender: req.BaseReq.From,
|
||||
Contract: contractAddr,
|
||||
Msg: req.ExecMsg,
|
||||
Funds: req.Amount,
|
||||
}
|
||||
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
|
||||
@@ -41,20 +41,20 @@ func TestInitGenesis(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
initCmd := MsgInstantiateContract{
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
InitFunds: deposit,
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
Funds: deposit,
|
||||
}
|
||||
res, err = h(data.ctx, &initCmd)
|
||||
require.NoError(t, err)
|
||||
contractBech32Addr := parseInitResponse(t, res.Data)
|
||||
|
||||
execCmd := MsgExecuteContract{
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: []byte(`{"release":{}}`),
|
||||
SentFunds: topUp,
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: []byte(`{"release":{}}`),
|
||||
Funds: topUp,
|
||||
}
|
||||
res, err = h(data.ctx, &execCmd)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -64,12 +64,12 @@ func (c *TestChain) StoreCode(byteCode []byte) types.MsgStoreCodeResponse {
|
||||
|
||||
func (c *TestChain) InstantiateContract(codeID uint64, initMsg []byte) sdk.AccAddress {
|
||||
instantiateMsg := &types.MsgInstantiateContract{
|
||||
Sender: c.SenderAccount.GetAddress().String(),
|
||||
Admin: c.SenderAccount.GetAddress().String(),
|
||||
CodeID: codeID,
|
||||
Label: "ibc-test",
|
||||
InitMsg: initMsg,
|
||||
InitFunds: sdk.Coins{TestCoin},
|
||||
Sender: c.SenderAccount.GetAddress().String(),
|
||||
Admin: c.SenderAccount.GetAddress().String(),
|
||||
CodeID: codeID,
|
||||
Label: "ibc-test",
|
||||
InitMsg: initMsg,
|
||||
Funds: sdk.Coins{TestCoin},
|
||||
}
|
||||
|
||||
r, err := c.SendMsgs(instantiateMsg)
|
||||
|
||||
@@ -549,7 +549,7 @@ func TestSupportedGenMsgTypes(t *testing.T) {
|
||||
Verifier: verifierAddress,
|
||||
Beneficiary: beneficiaryAddress,
|
||||
}.GetBytes(t),
|
||||
InitFunds: sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))),
|
||||
Funds: sdk.NewCoins(sdk.NewCoin(denom, sdk.NewInt(10))),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -181,10 +181,10 @@ func EncodeWasmMsg(sender sdk.AccAddress, msg *wasmvmtypes.WasmMsg) ([]sdk.Msg,
|
||||
}
|
||||
|
||||
sdkMsg := types.MsgExecuteContract{
|
||||
Sender: sender.String(),
|
||||
Contract: msg.Execute.ContractAddr,
|
||||
Msg: msg.Execute.Msg,
|
||||
SentFunds: coins,
|
||||
Sender: sender.String(),
|
||||
Contract: msg.Execute.ContractAddr,
|
||||
Msg: msg.Execute.Msg,
|
||||
Funds: coins,
|
||||
}
|
||||
return []sdk.Msg{&sdkMsg}, nil
|
||||
case msg.Instantiate != nil:
|
||||
@@ -197,9 +197,9 @@ func EncodeWasmMsg(sender sdk.AccAddress, msg *wasmvmtypes.WasmMsg) ([]sdk.Msg,
|
||||
Sender: sender.String(),
|
||||
CodeID: msg.Instantiate.CodeID,
|
||||
// TODO: add this to CosmWasm
|
||||
Label: fmt.Sprintf("Auto-created by %s", sender),
|
||||
InitMsg: msg.Instantiate.Msg,
|
||||
InitFunds: coins,
|
||||
Label: fmt.Sprintf("Auto-created by %s", sender),
|
||||
InitMsg: msg.Instantiate.Msg,
|
||||
Funds: coins,
|
||||
}
|
||||
return []sdk.Msg{&sdkMsg}, nil
|
||||
default:
|
||||
|
||||
@@ -130,10 +130,10 @@ func TestEncoding(t *testing.T) {
|
||||
},
|
||||
output: []sdk.Msg{
|
||||
&types.MsgExecuteContract{
|
||||
Sender: addr1.String(),
|
||||
Contract: addr2.String(),
|
||||
Msg: jsonMsg,
|
||||
SentFunds: sdk.NewCoins(sdk.NewInt64Coin("eth", 12)),
|
||||
Sender: addr1.String(),
|
||||
Contract: addr2.String(),
|
||||
Msg: jsonMsg,
|
||||
Funds: sdk.NewCoins(sdk.NewInt64Coin("eth", 12)),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -155,9 +155,9 @@ func TestEncoding(t *testing.T) {
|
||||
Sender: addr1.String(),
|
||||
CodeID: 7,
|
||||
// TODO: fix this
|
||||
Label: fmt.Sprintf("Auto-created by %s", addr1),
|
||||
InitMsg: jsonMsg,
|
||||
InitFunds: sdk.NewCoins(sdk.NewInt64Coin("eth", 123)),
|
||||
Label: fmt.Sprintf("Auto-created by %s", addr1),
|
||||
InitMsg: jsonMsg,
|
||||
Funds: sdk.NewCoins(sdk.NewInt64Coin("eth", 123)),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -55,7 +55,7 @@ func (m msgServer) InstantiateContract(goCtx context.Context, msg *types.MsgInst
|
||||
}
|
||||
}
|
||||
|
||||
contractAddr, err := m.keeper.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.InitFunds)
|
||||
contractAddr, err := m.keeper.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.Funds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteC
|
||||
return nil, sdkerrors.Wrap(err, "contract")
|
||||
}
|
||||
|
||||
res, err := m.keeper.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.SentFunds)
|
||||
res, err := m.keeper.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.Funds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ func handleInstantiateProposal(ctx sdk.Context, k Keeper, p types.InstantiateCon
|
||||
return sdkerrors.Wrap(err, "admin")
|
||||
}
|
||||
|
||||
contractAddr, err := k.instantiate(ctx, p.CodeID, runAsAddr, adminAddr, p.InitMsg, p.Label, p.InitFunds, GovAuthorizationPolicy{})
|
||||
contractAddr, err := k.instantiate(ctx, p.CodeID, runAsAddr, adminAddr, p.InitMsg, p.Label, p.Funds, GovAuthorizationPolicy{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ func handleInstantiate(ctx sdk.Context, k *Keeper, msg *types.MsgInstantiateCont
|
||||
}
|
||||
}
|
||||
|
||||
contractAddr, err := k.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.InitFunds)
|
||||
contractAddr, err := k.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.InitMsg, msg.Label, msg.Funds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -373,7 +373,7 @@ func handleExecute(ctx sdk.Context, k *Keeper, msg *types.MsgExecuteContract) (*
|
||||
if err != nil {
|
||||
return nil, sdkerrors.Wrap(err, "admin")
|
||||
}
|
||||
res, err := k.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.SentFunds)
|
||||
res, err := k.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.Funds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ func (p InstantiateContractProposal) ValidateBasic() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !p.InitFunds.IsValid() {
|
||||
if !p.Funds.IsValid() {
|
||||
return sdkerrors.ErrInvalidCoins
|
||||
}
|
||||
|
||||
@@ -190,8 +190,8 @@ func (p InstantiateContractProposal) String() string {
|
||||
Code id: %d
|
||||
Label: %s
|
||||
InitMsg: %q
|
||||
InitFunds: %s
|
||||
`, p.Title, p.Description, p.RunAs, p.Admin, p.CodeID, p.Label, p.InitMsg, p.InitFunds)
|
||||
Funds: %s
|
||||
`, p.Title, p.Description, p.RunAs, p.Admin, p.CodeID, p.Label, p.InitMsg, p.Funds)
|
||||
}
|
||||
|
||||
// MarshalYAML pretty prints the init message
|
||||
@@ -204,7 +204,7 @@ func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) {
|
||||
CodeID uint64 `yaml:"code_id"`
|
||||
Label string `yaml:"label"`
|
||||
InitMsg string `yaml:"init_msg"`
|
||||
InitFunds sdk.Coins `yaml:"init_funds"`
|
||||
Funds sdk.Coins `yaml:"funds"`
|
||||
}{
|
||||
Title: p.Title,
|
||||
Description: p.Description,
|
||||
@@ -213,7 +213,7 @@ func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) {
|
||||
CodeID: p.CodeID,
|
||||
Label: p.Label,
|
||||
InitMsg: string(p.InitMsg),
|
||||
InitFunds: p.InitFunds,
|
||||
Funds: p.Funds,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ type InstantiateContractProposal struct {
|
||||
Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"`
|
||||
// InitMsg json encoded message to be passed to the contract on instantiation
|
||||
InitMsg encoding_json.RawMessage `protobuf:"bytes,7,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
|
||||
// InitFunds coins that are transferred to the contract on instantiation
|
||||
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
|
||||
// Funds coins that are transferred to the contract on instantiation
|
||||
Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"`
|
||||
}
|
||||
|
||||
func (m *InstantiateContractProposal) Reset() { *m = InstantiateContractProposal{} }
|
||||
@@ -276,49 +276,48 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_00b43267813130fb = []byte{
|
||||
// 658 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x4d, 0x6f, 0xd3, 0x30,
|
||||
0x18, 0xc7, 0x9b, 0xbd, 0xa4, 0xad, 0x5b, 0xa1, 0x11, 0xba, 0x11, 0x06, 0x4a, 0x4b, 0xc6, 0xa1,
|
||||
0x17, 0x92, 0x6d, 0x48, 0x20, 0x21, 0x71, 0x68, 0x8a, 0x90, 0x76, 0xa8, 0x34, 0x65, 0x82, 0x49,
|
||||
0xbb, 0x44, 0x4e, 0xe2, 0x65, 0x1e, 0x89, 0x1d, 0xc5, 0x2e, 0x5d, 0xbf, 0x05, 0x1f, 0x80, 0x0f,
|
||||
0x30, 0xf1, 0x49, 0x76, 0xdc, 0x71, 0xa7, 0xc2, 0xd2, 0x0b, 0x67, 0x8e, 0x9c, 0x90, 0x9d, 0xac,
|
||||
0x74, 0xd2, 0x84, 0x26, 0xf1, 0x72, 0xb1, 0xf3, 0xe4, 0xf9, 0x3f, 0x2f, 0xfe, 0xe5, 0x89, 0xc1,
|
||||
0x93, 0x13, 0x7b, 0x04, 0x59, 0x62, 0x63, 0xc2, 0x51, 0x46, 0x60, 0x6c, 0xf3, 0x71, 0x8a, 0x98,
|
||||
0x9d, 0x66, 0x34, 0xa5, 0x0c, 0xc6, 0x56, 0x9a, 0x51, 0x4e, 0xb5, 0xd5, 0x80, 0xb2, 0x44, 0xe8,
|
||||
0x2c, 0xb9, 0x7c, 0xd8, 0xf2, 0x11, 0x87, 0x5b, 0xeb, 0xad, 0x88, 0x46, 0x54, 0x2a, 0x6c, 0xf1,
|
||||
0x54, 0x88, 0xd7, 0x0d, 0x21, 0xa6, 0xcc, 0xf6, 0x21, 0x43, 0x76, 0x29, 0xb5, 0x03, 0x8a, 0x49,
|
||||
0xe9, 0x7f, 0x7c, 0x73, 0x49, 0xb9, 0x16, 0x12, 0xf3, 0x74, 0x01, 0xdc, 0xdd, 0xe3, 0x34, 0x43,
|
||||
0x7d, 0x1a, 0xa2, 0xdd, 0xb2, 0x17, 0xad, 0x05, 0x96, 0x39, 0xe6, 0x31, 0xd2, 0x95, 0x8e, 0xd2,
|
||||
0xad, 0xbb, 0x85, 0xa1, 0x75, 0x40, 0x23, 0x44, 0x2c, 0xc8, 0x70, 0xca, 0x31, 0x25, 0xfa, 0x82,
|
||||
0xf4, 0xcd, 0xbf, 0xd2, 0x56, 0x81, 0x9a, 0x0d, 0x89, 0x07, 0x99, 0xbe, 0x58, 0x04, 0x66, 0x43,
|
||||
0xd2, 0x63, 0xda, 0x73, 0x70, 0x47, 0xf4, 0xe1, 0xf9, 0x63, 0x8e, 0xbc, 0x80, 0x86, 0x48, 0x5f,
|
||||
0xea, 0x28, 0xdd, 0xa6, 0xb3, 0x92, 0x4f, 0xda, 0xcd, 0xfd, 0xde, 0xde, 0xc0, 0x19, 0x73, 0xd9,
|
||||
0x80, 0xdb, 0x14, 0xba, 0x2b, 0x4b, 0x5b, 0x03, 0x2a, 0xa3, 0xc3, 0x2c, 0x40, 0xfa, 0xb2, 0x4c,
|
||||
0x57, 0x5a, 0x9a, 0x0e, 0xaa, 0xfe, 0x10, 0xc7, 0x21, 0xca, 0x74, 0x55, 0x3a, 0xae, 0x4c, 0xed,
|
||||
0x00, 0xac, 0x61, 0xc2, 0x38, 0x24, 0x1c, 0x43, 0x8e, 0xbc, 0x14, 0x65, 0x09, 0x66, 0x4c, 0x74,
|
||||
0x5b, 0xed, 0x28, 0xdd, 0xc6, 0xf6, 0x86, 0x75, 0x23, 0x5f, 0xab, 0x17, 0x04, 0x88, 0xb1, 0x3e,
|
||||
0x25, 0x87, 0x38, 0x72, 0x57, 0xe7, 0x52, 0xec, 0xce, 0x32, 0x98, 0xf9, 0x02, 0x78, 0xb8, 0xf3,
|
||||
0xcb, 0xd3, 0xa7, 0x84, 0x67, 0x30, 0xe0, 0xff, 0x0a, 0x5a, 0x0b, 0x2c, 0xc3, 0x30, 0xc1, 0x44,
|
||||
0xb2, 0xaa, 0xbb, 0x85, 0xa1, 0x6d, 0x80, 0xaa, 0x00, 0xe8, 0xe1, 0x50, 0x32, 0x59, 0x72, 0x40,
|
||||
0x3e, 0x69, 0xab, 0x82, 0xd6, 0xce, 0x6b, 0x57, 0x15, 0xae, 0x9d, 0x50, 0x84, 0xc6, 0xd0, 0x47,
|
||||
0x71, 0x49, 0xa7, 0x30, 0xb4, 0x17, 0xa0, 0x86, 0x09, 0xe6, 0x5e, 0xc2, 0x22, 0x49, 0xa3, 0xe9,
|
||||
0x3c, 0xfa, 0x31, 0x69, 0xeb, 0x88, 0x04, 0x34, 0xc4, 0x24, 0xb2, 0x8f, 0x19, 0x25, 0x96, 0x0b,
|
||||
0x47, 0x03, 0xc4, 0x18, 0x8c, 0x90, 0x5b, 0x15, 0xea, 0x01, 0x8b, 0xb4, 0x63, 0x00, 0x64, 0xe0,
|
||||
0xe1, 0x90, 0x84, 0x4c, 0xaf, 0x75, 0x16, 0xbb, 0x8d, 0xed, 0x07, 0x56, 0x31, 0x7b, 0x96, 0x98,
|
||||
0xbd, 0x19, 0xc6, 0x3e, 0xc5, 0xc4, 0xd9, 0x3c, 0x9b, 0xb4, 0x2b, 0x9f, 0xbf, 0xb4, 0xbb, 0x11,
|
||||
0xe6, 0x47, 0x43, 0xdf, 0x0a, 0x68, 0x62, 0x97, 0x83, 0x5a, 0x6c, 0x4f, 0x59, 0xf8, 0xbe, 0x1c,
|
||||
0x42, 0x11, 0xc0, 0xdc, 0xba, 0x48, 0xff, 0x46, 0x64, 0x37, 0xbf, 0x29, 0xe0, 0xfe, 0x00, 0x47,
|
||||
0xd9, 0x7f, 0x00, 0xbc, 0x0e, 0x6a, 0x41, 0x59, 0xa2, 0x64, 0x3c, 0xb3, 0x6f, 0x87, 0xf9, 0x15,
|
||||
0x68, 0x24, 0x45, 0xab, 0x92, 0xa9, 0x7a, 0x0b, 0xa6, 0xa0, 0x0c, 0x18, 0xb0, 0xc8, 0xfc, 0xa4,
|
||||
0x80, 0x7b, 0x6f, 0xd3, 0x10, 0x72, 0xd4, 0x13, 0x9f, 0xf6, 0x8f, 0x8f, 0xb9, 0x05, 0xea, 0x04,
|
||||
0x8d, 0xbc, 0x62, 0x68, 0xe4, 0x49, 0x9d, 0xd6, 0xf7, 0x49, 0x7b, 0x65, 0x0c, 0x93, 0xf8, 0xa5,
|
||||
0x39, 0x73, 0x99, 0x6e, 0x8d, 0xa0, 0x91, 0x2c, 0xf9, 0x3b, 0x04, 0xe6, 0x11, 0xd0, 0xfa, 0x31,
|
||||
0x82, 0xd9, 0xdf, 0x69, 0x6e, 0xbe, 0xd2, 0xe2, 0xf5, 0x4a, 0xce, 0xbb, 0xb3, 0x4b, 0xa3, 0x72,
|
||||
0x71, 0x69, 0x54, 0x4e, 0x73, 0x43, 0x39, 0xcb, 0x0d, 0xe5, 0x3c, 0x37, 0x94, 0xaf, 0xb9, 0xa1,
|
||||
0x7c, 0x9c, 0x1a, 0x95, 0xf3, 0xa9, 0x51, 0xb9, 0x98, 0x1a, 0x95, 0x83, 0xcd, 0xb9, 0x71, 0xea,
|
||||
0x53, 0x96, 0xec, 0x8b, 0x9b, 0x4d, 0xfc, 0xc4, 0xa1, 0x7d, 0x52, 0xee, 0xd7, 0xef, 0x39, 0x5f,
|
||||
0x95, 0x57, 0xdc, 0xb3, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0xd1, 0x29, 0x31, 0x7a, 0x05,
|
||||
0x00, 0x00,
|
||||
// 654 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0x4f, 0x6f, 0xd3, 0x3e,
|
||||
0x18, 0xc7, 0x9b, 0x6d, 0x4d, 0x3b, 0xb7, 0xfa, 0x69, 0xbf, 0xd0, 0x8d, 0x30, 0x50, 0x5a, 0x32,
|
||||
0x0e, 0xbd, 0x90, 0x6c, 0x43, 0x02, 0x09, 0x89, 0x43, 0x53, 0x2e, 0x3b, 0x54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 0x37, 0x17, 0x8b, 0x40, 0x36,
|
||||
0x24, 0x3d, 0x6e, 0x3c, 0x05, 0xff, 0xc9, 0x3e, 0x82, 0x70, 0x2c, 0x50, 0x10, 0xd1, 0x18, 0x99,
|
||||
0x4b, 0x1d, 0xad, 0xdb, 0xf4, 0x56, 0xa6, 0x93, 0x76, 0x73, 0xbf, 0xb7, 0x37, 0xf0, 0xc6, 0x42,
|
||||
0x35, 0xe0, 0x37, 0xa5, 0xee, 0xca, 0x32, 0xd6, 0x80, 0xce, 0xe9, 0x90, 0x45, 0xc8, 0xac, 0xaa,
|
||||
0x74, 0xa5, 0x65, 0x98, 0xa0, 0x16, 0x0e, 0x71, 0x1a, 0x23, 0x66, 0xea, 0xca, 0x71, 0x65, 0x1a,
|
||||
0x07, 0x60, 0x0d, 0x13, 0x2e, 0x20, 0x11, 0x18, 0x0a, 0x14, 0xe4, 0x88, 0x65, 0x98, 0x73, 0xd9,
|
||||
0x6d, 0xad, 0xa3, 0x75, 0x1b, 0xdb, 0x1b, 0xce, 0x8d, 0x7c, 0x9d, 0x5e, 0x14, 0x21, 0xce, 0xfb,
|
||||
0x94, 0x1c, 0xe2, 0xc4, 0x5f, 0x9d, 0x4b, 0xb1, 0x3b, 0xcb, 0x60, 0x7f, 0x5a, 0x00, 0xf7, 0x77,
|
||||
0x7e, 0x7a, 0xfa, 0x94, 0x08, 0x06, 0x23, 0xf1, 0xb7, 0xa0, 0xb5, 0x40, 0x15, 0xc6, 0x19, 0x26,
|
||||
0x8a, 0xd5, 0xb2, 0x5f, 0x18, 0xc6, 0x06, 0xa8, 0x49, 0x80, 0x01, 0x8e, 0x15, 0x93, 0x25, 0x0f,
|
||||
0x4c, 0x27, 0x6d, 0x5d, 0xd2, 0xda, 0x79, 0xe9, 0xeb, 0xd2, 0xb5, 0x13, 0xcb, 0xd0, 0x14, 0x86,
|
||||
0x28, 0x2d, 0xe9, 0x14, 0x86, 0xf1, 0x0c, 0xd4, 0x31, 0xc1, 0x22, 0xc8, 0x78, 0xa2, 0x68, 0x34,
|
||||
0xbd, 0x07, 0xdf, 0x27, 0x6d, 0x13, 0x91, 0x88, 0xc6, 0x98, 0x24, 0xee, 0x1b, 0x4e, 0x89, 0xe3,
|
||||
0xc3, 0xd1, 0x00, 0x71, 0x0e, 0x13, 0xe4, 0xd7, 0xa4, 0x7a, 0xc0, 0x13, 0x03, 0x82, 0xea, 0xe1,
|
||||
0x90, 0xc4, 0xdc, 0xac, 0x77, 0x16, 0xbb, 0x8d, 0xed, 0x7b, 0x4e, 0x31, 0x76, 0x8e, 0x1c, 0xbb,
|
||||
0x19, 0xc1, 0x3e, 0xc5, 0xc4, 0xdb, 0x3c, 0x9d, 0xb4, 0x2b, 0x1f, 0x3f, 0xb7, 0xbb, 0x09, 0x16,
|
||||
0x47, 0xc3, 0xd0, 0x89, 0x68, 0xe6, 0x96, 0x33, 0x5a, 0x6c, 0x8f, 0x79, 0xfc, 0xb6, 0x9c, 0x3f,
|
||||
0x19, 0xc0, 0xfd, 0x22, 0xb3, 0xfd, 0x55, 0x03, 0x77, 0x07, 0x38, 0x61, 0xff, 0x80, 0xeb, 0x3a,
|
||||
0xa8, 0x47, 0x65, 0x89, 0x12, 0xed, 0xcc, 0xbe, 0x1d, 0xdd, 0x17, 0xa0, 0x91, 0x15, 0xad, 0x2a,
|
||||
0x94, 0xfa, 0x2d, 0x50, 0x82, 0x32, 0x60, 0xc0, 0x13, 0xfb, 0x83, 0x06, 0xee, 0xbc, 0xca, 0x63,
|
||||
0x28, 0x50, 0x4f, 0x7e, 0xd1, 0xdf, 0x3e, 0xe6, 0x16, 0x58, 0x26, 0x68, 0x14, 0x14, 0xb3, 0xa2,
|
||||
0x4e, 0xea, 0xb5, 0xbe, 0x4d, 0xda, 0x2b, 0x63, 0x98, 0xa5, 0xcf, 0xed, 0x99, 0xcb, 0xf6, 0xeb,
|
||||
0x04, 0x8d, 0x54, 0xc9, 0x5f, 0x21, 0xb0, 0x8f, 0x80, 0xd1, 0x4f, 0x11, 0x64, 0x7f, 0xa6, 0xb9,
|
||||
0xf9, 0x4a, 0x8b, 0xd7, 0x2b, 0x79, 0xaf, 0x4f, 0x2f, 0xac, 0xca, 0xf9, 0x85, 0x55, 0x39, 0x99,
|
||||
0x5a, 0xda, 0xe9, 0xd4, 0xd2, 0xce, 0xa6, 0x96, 0xf6, 0x65, 0x6a, 0x69, 0xef, 0x2f, 0xad, 0xca,
|
||||
0xd9, 0xa5, 0x55, 0x39, 0xbf, 0xb4, 0x2a, 0x07, 0x9b, 0x73, 0xa3, 0xd4, 0xa7, 0x3c, 0xdb, 0x97,
|
||||
0x17, 0x9a, 0xfc, 0x77, 0x63, 0xf7, 0xb8, 0xdc, 0xaf, 0x5f, 0x6f, 0xa1, 0xae, 0x6e, 0xb6, 0x27,
|
||||
0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xcb, 0x63, 0x29, 0x71, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *StoreCodeProposal) Equal(that interface{}) bool {
|
||||
@@ -403,11 +402,11 @@ func (this *InstantiateContractProposal) Equal(that interface{}) bool {
|
||||
if !bytes.Equal(this.InitMsg, that1.InitMsg) {
|
||||
return false
|
||||
}
|
||||
if len(this.InitFunds) != len(that1.InitFunds) {
|
||||
if len(this.Funds) != len(that1.Funds) {
|
||||
return false
|
||||
}
|
||||
for i := range this.InitFunds {
|
||||
if !this.InitFunds[i].Equal(&that1.InitFunds[i]) {
|
||||
for i := range this.Funds {
|
||||
if !this.Funds[i].Equal(&that1.Funds[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -612,10 +611,10 @@ func (m *InstantiateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, er
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.InitFunds) > 0 {
|
||||
for iNdEx := len(m.InitFunds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
if len(m.Funds) > 0 {
|
||||
for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.InitFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -915,8 +914,8 @@ func (m *InstantiateContractProposal) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovProposal(uint64(l))
|
||||
}
|
||||
if len(m.InitFunds) > 0 {
|
||||
for _, e := range m.InitFunds {
|
||||
if len(m.Funds) > 0 {
|
||||
for _, e := range m.Funds {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovProposal(uint64(l))
|
||||
}
|
||||
@@ -1535,7 +1534,7 @@ func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 8:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field InitFunds", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1562,8 +1561,8 @@ func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.InitFunds = append(m.InitFunds, types.Coin{})
|
||||
if err := m.InitFunds[len(m.InitFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
m.Funds = append(m.Funds, types.Coin{})
|
||||
if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
||||
@@ -44,8 +44,8 @@ message InstantiateContractProposal {
|
||||
string label = 6;
|
||||
// InitMsg json encoded message to be passed to the contract on instantiation
|
||||
bytes init_msg = 7 [(gogoproto.casttype) = "encoding/json.RawMessage"];
|
||||
// InitFunds coins that are transferred to the contract on instantiation
|
||||
repeated cosmos.base.v1beta1.Coin init_funds = 8 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
// Funds coins that are transferred to the contract on instantiation
|
||||
repeated cosmos.base.v1beta1.Coin funds = 8 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
}
|
||||
|
||||
// MigrateContractProposal gov proposal content type to migrate a contract.
|
||||
|
||||
@@ -202,7 +202,7 @@ func TestValidateInstantiateContractProposal(t *testing.T) {
|
||||
},
|
||||
"without init funds": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) {
|
||||
p.InitFunds = nil
|
||||
p.Funds = nil
|
||||
}),
|
||||
},
|
||||
"base data missing": {
|
||||
@@ -243,13 +243,13 @@ func TestValidateInstantiateContractProposal(t *testing.T) {
|
||||
},
|
||||
"init funds negative": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) {
|
||||
p.InitFunds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(-1)}}
|
||||
p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(-1)}}
|
||||
}),
|
||||
expErr: true,
|
||||
},
|
||||
"init funds with duplicates": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) {
|
||||
p.InitFunds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "foo", Amount: sdk.NewInt(2)}}
|
||||
p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "foo", Amount: sdk.NewInt(2)}}
|
||||
}),
|
||||
expErr: true,
|
||||
},
|
||||
@@ -450,7 +450,7 @@ func TestProposalStrings(t *testing.T) {
|
||||
},
|
||||
"instantiate contract": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) {
|
||||
p.InitFunds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.NewInt(2)}}
|
||||
p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.NewInt(2)}}
|
||||
}),
|
||||
exp: `Instantiate Code Proposal:
|
||||
Title: Foo
|
||||
@@ -460,11 +460,11 @@ func TestProposalStrings(t *testing.T) {
|
||||
Code id: 1
|
||||
Label: testing
|
||||
InitMsg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\"}"
|
||||
InitFunds: 1foo,2bar
|
||||
Funds: 1foo,2bar
|
||||
`,
|
||||
},
|
||||
"instantiate contract without funds": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.InitFunds = nil }),
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Funds = nil }),
|
||||
exp: `Instantiate Code Proposal:
|
||||
Title: Foo
|
||||
Description: Bar
|
||||
@@ -473,7 +473,7 @@ func TestProposalStrings(t *testing.T) {
|
||||
Code id: 1
|
||||
Label: testing
|
||||
InitMsg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\"}"
|
||||
InitFunds:
|
||||
Funds:
|
||||
`,
|
||||
},
|
||||
"instantiate contract without admin": {
|
||||
@@ -486,7 +486,7 @@ func TestProposalStrings(t *testing.T) {
|
||||
Code id: 1
|
||||
Label: testing
|
||||
InitMsg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du\"}"
|
||||
InitFunds:
|
||||
Funds:
|
||||
`,
|
||||
},
|
||||
"migrate contract": {
|
||||
@@ -545,7 +545,7 @@ instantiate_permission: null
|
||||
},
|
||||
"instantiate contract": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) {
|
||||
p.InitFunds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.NewInt(2)}}
|
||||
p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.NewInt(2)}}
|
||||
}),
|
||||
exp: `title: Foo
|
||||
description: Bar
|
||||
@@ -554,7 +554,7 @@ admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du
|
||||
code_id: 1
|
||||
label: testing
|
||||
init_msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du"}'
|
||||
init_funds:
|
||||
funds:
|
||||
- denom: foo
|
||||
amount: "1"
|
||||
- denom: bar
|
||||
@@ -562,7 +562,7 @@ init_funds:
|
||||
`,
|
||||
},
|
||||
"instantiate contract without funds": {
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.InitFunds = nil }),
|
||||
src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Funds = nil }),
|
||||
exp: `title: Foo
|
||||
description: Bar
|
||||
run_as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du
|
||||
@@ -570,7 +570,7 @@ admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du
|
||||
code_id: 1
|
||||
label: testing
|
||||
init_msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du"}'
|
||||
init_funds: []
|
||||
funds: []
|
||||
`,
|
||||
},
|
||||
"instantiate contract without admin": {
|
||||
@@ -582,7 +582,7 @@ admin: ""
|
||||
code_id: 1
|
||||
label: testing
|
||||
init_msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpjnp7du"}'
|
||||
init_funds: []
|
||||
funds: []
|
||||
`,
|
||||
},
|
||||
"migrate contract": {
|
||||
|
||||
@@ -150,7 +150,7 @@ func MsgInstantiateContractFixture(mutators ...func(*MsgInstantiateContract)) *M
|
||||
CodeID: 1,
|
||||
Label: "testing",
|
||||
InitMsg: []byte(`{"foo":"bar"}`),
|
||||
InitFunds: sdk.Coins{{
|
||||
Funds: sdk.Coins{{
|
||||
Denom: "stake",
|
||||
Amount: sdk.NewInt(1),
|
||||
}},
|
||||
@@ -170,7 +170,7 @@ func MsgExecuteContractFixture(mutators ...func(*MsgExecuteContract)) *MsgExecut
|
||||
Sender: anyAddress,
|
||||
Contract: firstContractAddress,
|
||||
Msg: []byte(`{"do":"something"}`),
|
||||
SentFunds: sdk.Coins{{
|
||||
Funds: sdk.Coins{{
|
||||
Denom: "stake",
|
||||
Amount: sdk.NewInt(1),
|
||||
}},
|
||||
@@ -223,7 +223,7 @@ func InstantiateContractProposalFixture(mutators ...func(p *InstantiateContractP
|
||||
CodeID: 1,
|
||||
Label: "testing",
|
||||
InitMsg: initMsgBz,
|
||||
InitFunds: nil,
|
||||
Funds: nil,
|
||||
}
|
||||
|
||||
for _, m := range mutators {
|
||||
|
||||
@@ -75,7 +75,7 @@ func (msg MsgInstantiateContract) ValidateBasic() error {
|
||||
|
||||
}
|
||||
|
||||
if !msg.InitFunds.IsValid() {
|
||||
if !msg.Funds.IsValid() {
|
||||
return sdkerrors.ErrInvalidCoins
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ func (msg MsgExecuteContract) ValidateBasic() error {
|
||||
return sdkerrors.Wrap(err, "contract")
|
||||
}
|
||||
|
||||
if !msg.SentFunds.IsValid() {
|
||||
if !msg.Funds.IsValid() {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "sentFunds")
|
||||
}
|
||||
if !json.Valid(msg.Msg) {
|
||||
|
||||
@@ -129,8 +129,8 @@ type MsgInstantiateContract struct {
|
||||
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
|
||||
// InitMsg json encoded message to be passed to the contract on instantiation
|
||||
InitMsg encoding_json.RawMessage `protobuf:"bytes,5,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
|
||||
// InitFunds coins that are transferred to the contract on instantiation
|
||||
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
|
||||
// Funds coins that are transferred to the contract on instantiation
|
||||
Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"`
|
||||
}
|
||||
|
||||
func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} }
|
||||
@@ -213,8 +213,8 @@ type MsgExecuteContract struct {
|
||||
Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
|
||||
// Msg json encoded message to be passed to the contract
|
||||
Msg encoding_json.RawMessage `protobuf:"bytes,3,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"`
|
||||
// SentFunds coins that are transferred to the contract on execution
|
||||
SentFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=sent_funds,json=sentFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"sent_funds"`
|
||||
// Funds coins that are transferred to the contract on execution
|
||||
Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"`
|
||||
}
|
||||
|
||||
func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} }
|
||||
@@ -550,59 +550,58 @@ func init() {
|
||||
func init() { proto.RegisterFile("x/wasm/internal/types/tx.proto", fileDescriptor_5129e02f2349864e) }
|
||||
|
||||
var fileDescriptor_5129e02f2349864e = []byte{
|
||||
// 818 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0x8e, 0x37, 0x6d, 0xd2, 0xbc, 0x84, 0x05, 0x99, 0xb6, 0x18, 0x83, 0x9c, 0xe0, 0x05, 0x29,
|
||||
0x08, 0x6a, 0xb7, 0x45, 0x80, 0x04, 0xe2, 0xd0, 0x04, 0x90, 0x7a, 0x30, 0x42, 0x5e, 0xa1, 0x95,
|
||||
0x56, 0x42, 0x61, 0x62, 0xcf, 0x9a, 0x59, 0xe2, 0x99, 0xc8, 0x33, 0x21, 0xa9, 0xf8, 0x07, 0x9c,
|
||||
0xf8, 0x15, 0x1c, 0x10, 0x3f, 0xa4, 0xc7, 0x3d, 0x72, 0x0a, 0x90, 0x72, 0xe4, 0x17, 0x70, 0x42,
|
||||
0x33, 0x76, 0x5c, 0x37, 0xc4, 0x91, 0x11, 0xe2, 0x62, 0xcf, 0x1b, 0x7f, 0xef, 0xfb, 0xfc, 0x3e,
|
||||
0xbd, 0x37, 0x1a, 0xb0, 0x16, 0xee, 0x1c, 0xf1, 0xd8, 0x25, 0x54, 0xe0, 0x84, 0xa2, 0x89, 0x2b,
|
||||
0xae, 0xa6, 0x98, 0xbb, 0x62, 0xe1, 0x4c, 0x13, 0x26, 0x98, 0x7e, 0x14, 0x30, 0x1e, 0x4b, 0x84,
|
||||
0xa3, 0x1e, 0xdf, 0x9e, 0x8d, 0xb1, 0x40, 0x67, 0xa6, 0x25, 0xb7, 0x19, 0x77, 0xc7, 0x88, 0x63,
|
||||
0x37, 0xdb, 0x74, 0x03, 0x46, 0x68, 0x9a, 0x66, 0x1e, 0x46, 0x2c, 0x62, 0x6a, 0xe9, 0xca, 0x55,
|
||||
0xb6, 0xfb, 0x5a, 0x89, 0x98, 0x7c, 0xa6, 0x10, 0xfb, 0x4f, 0x0d, 0x3a, 0x1e, 0x8f, 0x1e, 0x0a,
|
||||
0x96, 0xe0, 0x21, 0x0b, 0xb1, 0x7e, 0x0c, 0x0d, 0x8e, 0x69, 0x88, 0x13, 0x43, 0xeb, 0x69, 0xfd,
|
||||
0x96, 0x9f, 0x45, 0xfa, 0x7b, 0x70, 0x5f, 0x72, 0x8d, 0xc6, 0x57, 0x02, 0x8f, 0x02, 0x16, 0x62,
|
||||
0xe3, 0x5e, 0x4f, 0xeb, 0x77, 0x06, 0x2f, 0xac, 0x96, 0xdd, 0xce, 0xa3, 0x8b, 0x87, 0xde, 0xe0,
|
||||
0x4a, 0x28, 0x06, 0xbf, 0x23, 0x71, 0xeb, 0x48, 0xf1, 0xb1, 0x59, 0x12, 0x60, 0xa3, 0x9e, 0xf1,
|
||||
0xa9, 0x48, 0x37, 0xa0, 0x39, 0x9e, 0x91, 0x89, 0x14, 0xda, 0x53, 0x1f, 0xd6, 0xa1, 0xfe, 0x18,
|
||||
0x8e, 0x09, 0xe5, 0x02, 0x51, 0x41, 0x90, 0xc0, 0xa3, 0x29, 0x4e, 0x62, 0xc2, 0x39, 0x61, 0xd4,
|
||||
0xd8, 0xef, 0x69, 0xfd, 0xf6, 0xf9, 0x03, 0x67, 0xab, 0x47, 0xce, 0x45, 0x10, 0x60, 0xce, 0x87,
|
||||
0x8c, 0x3e, 0x21, 0x91, 0x7f, 0x54, 0xa0, 0xf8, 0x3c, 0x67, 0xb0, 0x3f, 0x84, 0xc3, 0x62, 0xb5,
|
||||
0x3e, 0xe6, 0x53, 0x46, 0x39, 0xd6, 0x1f, 0x40, 0x53, 0xd6, 0x34, 0x22, 0xa1, 0x2a, 0x7b, 0x6f,
|
||||
0x00, 0xab, 0x65, 0xb7, 0x21, 0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x55, 0x00, 0xe5, 0xae, 0x7e, 0x07, 0x2f, 0x6e, 0x3b, 0x9c, 0x4e, 0xca, 0x39, 0xb6, 0xc0, 0xcd,
|
||||
0x77, 0xff, 0x15, 0x3c, 0x17, 0x67, 0xf0, 0xfc, 0xe6, 0xd0, 0xbe, 0x59, 0xce, 0xb4, 0x01, 0x35,
|
||||
0xcf, 0x2a, 0x43, 0x8b, 0x82, 0x9b, 0xc3, 0xb0, 0x43, 0x70, 0x03, 0xba, 0x4b, 0xb0, 0xac, 0x69,
|
||||
0x03, 0x68, 0x17, 0xbb, 0xf3, 0x8d, 0x72, 0x86, 0x02, 0xcc, 0x3c, 0xa9, 0x04, 0xcb, 0x45, 0xbe,
|
||||
0x02, 0x28, 0x74, 0xe1, 0xeb, 0xe5, 0xc9, 0xb7, 0x28, 0xf3, 0xed, 0x2a, 0xa8, 0xb5, 0xc2, 0xe0,
|
||||
0xb3, 0xeb, 0xdf, 0xad, 0xda, 0xf5, 0xca, 0xd2, 0x9e, 0xad, 0x2c, 0xed, 0xb7, 0x95, 0xa5, 0xfd,
|
||||
0x70, 0x63, 0xd5, 0x9e, 0xdd, 0x58, 0xb5, 0x5f, 0x6e, 0xac, 0xda, 0xe3, 0xd3, 0xc2, 0x69, 0x36,
|
||||
0x64, 0x3c, 0x7e, 0x24, 0x2f, 0x10, 0x92, 0x35, 0x74, 0x17, 0xd9, 0xfb, 0xee, 0x75, 0x62, 0xdc,
|
||||
0x50, 0x37, 0x89, 0x77, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xda, 0x83, 0x14, 0xdb, 0x08,
|
||||
0x00, 0x00,
|
||||
// 805 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xeb, 0x44,
|
||||
0x14, 0x8e, 0x6f, 0xfe, 0x9a, 0x93, 0x70, 0x41, 0xa6, 0x2d, 0xc6, 0x20, 0x27, 0xf8, 0x82, 0x14,
|
||||
0x04, 0xb5, 0xdb, 0x22, 0x40, 0x02, 0xb1, 0x68, 0x02, 0x8b, 0x2e, 0x8c, 0x90, 0xaf, 0xd0, 0x95,
|
||||
0x2a, 0xa1, 0x30, 0xb1, 0xa7, 0x66, 0x20, 0x9e, 0x89, 0x3c, 0x13, 0x92, 0x8a, 0x37, 0x60, 0xc5,
|
||||
0x0b, 0xf0, 0x02, 0x88, 0x07, 0xe9, 0xb2, 0x4b, 0x24, 0xa4, 0x00, 0xe9, 0x96, 0x27, 0x60, 0x85,
|
||||
0xc6, 0x76, 0x1c, 0x37, 0xc4, 0x91, 0x11, 0x62, 0x63, 0xcf, 0x19, 0x7f, 0xe7, 0xfb, 0x7c, 0x3e,
|
||||
0x9d, 0x33, 0x1a, 0x30, 0x16, 0xf6, 0x1c, 0xf1, 0xd0, 0x26, 0x54, 0xe0, 0x88, 0xa2, 0x89, 0x2d,
|
||||
0x6e, 0xa6, 0x98, 0xdb, 0x62, 0x61, 0x4d, 0x23, 0x26, 0x98, 0x7a, 0xe4, 0x31, 0x1e, 0x4a, 0x84,
|
||||
0x15, 0x3f, 0xbe, 0x3d, 0x1b, 0x63, 0x81, 0xce, 0x74, 0x43, 0x6e, 0x33, 0x6e, 0x8f, 0x11, 0xc7,
|
||||
0x76, 0xba, 0x69, 0x7b, 0x8c, 0xd0, 0x24, 0x4d, 0x3f, 0x0c, 0x58, 0xc0, 0xe2, 0xa5, 0x2d, 0x57,
|
||||
0xe9, 0xee, 0x6b, 0x05, 0x62, 0xf2, 0x99, 0x40, 0xcc, 0x3f, 0x15, 0xe8, 0x38, 0x3c, 0x78, 0x2a,
|
||||
0x58, 0x84, 0x87, 0xcc, 0xc7, 0xea, 0x31, 0x34, 0x38, 0xa6, 0x3e, 0x8e, 0x34, 0xa5, 0xa7, 0xf4,
|
||||
0x5b, 0x6e, 0x1a, 0xa9, 0xef, 0xc1, 0x63, 0xc9, 0x35, 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0, 0x4c, 0xe4, 0x4b, 0x80, 0x5c, 0x17, 0xbe, 0x5e, 0x9c, 0xbc, 0x41, 0xe9, 0x6f, 0x97, 0x41,
|
||||
0xad, 0x15, 0x06, 0x9f, 0xde, 0xfe, 0x61, 0x54, 0x6e, 0x57, 0x86, 0x72, 0xb7, 0x32, 0x94, 0xdf,
|
||||
0x57, 0x86, 0xf2, 0xc3, 0xbd, 0x51, 0xb9, 0xbb, 0x37, 0x2a, 0xbf, 0xdc, 0x1b, 0x95, 0xab, 0xd3,
|
||||
0xdc, 0x49, 0x36, 0x64, 0x3c, 0x7c, 0x26, 0xaf, 0x0b, 0x92, 0xd5, 0xb7, 0x17, 0xe9, 0xfb, 0xe1,
|
||||
0xe5, 0x61, 0xdc, 0x88, 0xef, 0x0d, 0xef, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x95, 0xe8,
|
||||
0x1b, 0xc9, 0x08, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -988,10 +987,10 @@ func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.InitFunds) > 0 {
|
||||
for iNdEx := len(m.InitFunds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
if len(m.Funds) > 0 {
|
||||
for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.InitFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1088,10 +1087,10 @@ func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.SentFunds) > 0 {
|
||||
for iNdEx := len(m.SentFunds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
if len(m.Funds) > 0 {
|
||||
for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.SentFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1439,8 +1438,8 @@ func (m *MsgInstantiateContract) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if len(m.InitFunds) > 0 {
|
||||
for _, e := range m.InitFunds {
|
||||
if len(m.Funds) > 0 {
|
||||
for _, e := range m.Funds {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
@@ -1479,8 +1478,8 @@ func (m *MsgExecuteContract) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if len(m.SentFunds) > 0 {
|
||||
for _, e := range m.SentFunds {
|
||||
if len(m.Funds) > 0 {
|
||||
for _, e := range m.Funds {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
@@ -2071,7 +2070,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field InitFunds", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2098,8 +2097,8 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.InitFunds = append(m.InitFunds, types.Coin{})
|
||||
if err := m.InitFunds[len(m.InitFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
m.Funds = append(m.Funds, types.Coin{})
|
||||
if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
@@ -2341,7 +2340,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SentFunds", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2368,8 +2367,8 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.SentFunds = append(m.SentFunds, types.Coin{})
|
||||
if err := m.SentFunds[len(m.SentFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
m.Funds = append(m.Funds, types.Coin{})
|
||||
if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
||||
@@ -56,8 +56,8 @@ message MsgInstantiateContract {
|
||||
string label = 4;
|
||||
// InitMsg json encoded message to be passed to the contract on instantiation
|
||||
bytes init_msg = 5 [(gogoproto.casttype) = "encoding/json.RawMessage"];
|
||||
// InitFunds coins that are transferred to the contract on instantiation
|
||||
repeated cosmos.base.v1beta1.Coin init_funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
// Funds coins that are transferred to the contract on instantiation
|
||||
repeated cosmos.base.v1beta1.Coin funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
}
|
||||
// MsgInstantiateContractResponse return instantiation result data
|
||||
message MsgInstantiateContractResponse {
|
||||
@@ -73,8 +73,8 @@ message MsgExecuteContract {
|
||||
string contract = 2;
|
||||
// Msg json encoded message to be passed to the contract
|
||||
bytes msg = 3 [(gogoproto.casttype) = "encoding/json.RawMessage"];
|
||||
// SentFunds coins that are transferred to the contract on execution
|
||||
repeated cosmos.base.v1beta1.Coin sent_funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
// Funds coins that are transferred to the contract on execution
|
||||
repeated cosmos.base.v1beta1.Coin funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||
}
|
||||
|
||||
// MsgExecuteContractResponse returns execution result data.
|
||||
|
||||
@@ -189,11 +189,11 @@ func TestInstantiateContractValidation(t *testing.T) {
|
||||
},
|
||||
"correct maximal": {
|
||||
msg: MsgInstantiateContract{
|
||||
Sender: goodAddress,
|
||||
CodeID: firstCodeID,
|
||||
Label: "foo",
|
||||
InitMsg: []byte(`{"some": "data"}`),
|
||||
InitFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
||||
Sender: goodAddress,
|
||||
CodeID: firstCodeID,
|
||||
Label: "foo",
|
||||
InitMsg: []byte(`{"some": "data"}`),
|
||||
Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
||||
},
|
||||
valid: true,
|
||||
},
|
||||
@@ -204,7 +204,7 @@ func TestInstantiateContractValidation(t *testing.T) {
|
||||
Label: "foo",
|
||||
InitMsg: []byte(`{"some": "data"}`),
|
||||
// we cannot use sdk.NewCoin() constructors as they panic on creating invalid data (before we can test)
|
||||
InitFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(-200)}},
|
||||
Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(-200)}},
|
||||
},
|
||||
valid: false,
|
||||
},
|
||||
@@ -264,10 +264,10 @@ func TestExecuteContractValidation(t *testing.T) {
|
||||
},
|
||||
"correct all": {
|
||||
msg: MsgExecuteContract{
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
SentFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}},
|
||||
},
|
||||
valid: true,
|
||||
},
|
||||
@@ -303,19 +303,19 @@ func TestExecuteContractValidation(t *testing.T) {
|
||||
},
|
||||
"negative funds": {
|
||||
msg: MsgExecuteContract{
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
SentFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(-1)}},
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(-1)}},
|
||||
},
|
||||
valid: false,
|
||||
},
|
||||
"duplicate funds": {
|
||||
msg: MsgExecuteContract{
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
SentFunds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(1)}, sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(1)}},
|
||||
Sender: goodAddress,
|
||||
Contract: goodAddress,
|
||||
Msg: []byte(`{"some": "data"}`),
|
||||
Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(1)}, sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(1)}},
|
||||
},
|
||||
valid: false,
|
||||
},
|
||||
|
||||
@@ -169,10 +169,10 @@ func TestHandleInstantiate(t *testing.T) {
|
||||
|
||||
// create with no balance is also legal
|
||||
initCmd := MsgInstantiateContract{
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
InitFunds: nil,
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
Funds: nil,
|
||||
}
|
||||
res, err = h(data.ctx, &initCmd)
|
||||
require.NoError(t, err)
|
||||
@@ -226,10 +226,10 @@ func TestHandleExecute(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
initCmd := MsgInstantiateContract{
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
InitFunds: deposit,
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
Funds: deposit,
|
||||
}
|
||||
res, err = h(data.ctx, &initCmd)
|
||||
require.NoError(t, err)
|
||||
@@ -261,10 +261,10 @@ func TestHandleExecute(t *testing.T) {
|
||||
assert.Equal(t, deposit, data.bankKeeper.GetAllBalances(data.ctx, contractAcct.GetAddress()))
|
||||
|
||||
execCmd := MsgExecuteContract{
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: []byte(`{"release":{}}`),
|
||||
SentFunds: topUp,
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: []byte(`{"release":{}}`),
|
||||
Funds: topUp,
|
||||
}
|
||||
res, err = h(data.ctx, &execCmd)
|
||||
require.NoError(t, err)
|
||||
@@ -343,10 +343,10 @@ func TestHandleExecuteEscrow(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
initCmd := MsgInstantiateContract{
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
InitFunds: deposit,
|
||||
Sender: creator.String(),
|
||||
CodeID: firstCodeID,
|
||||
InitMsg: initMsgBz,
|
||||
Funds: deposit,
|
||||
}
|
||||
res, err = h(data.ctx, &initCmd)
|
||||
require.NoError(t, err)
|
||||
@@ -360,10 +360,10 @@ func TestHandleExecuteEscrow(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
execCmd := MsgExecuteContract{
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: handleMsgBz,
|
||||
SentFunds: topUp,
|
||||
Sender: fred.String(),
|
||||
Contract: contractBech32Addr,
|
||||
Msg: handleMsgBz,
|
||||
Funds: topUp,
|
||||
}
|
||||
res, err = h(data.ctx, &execCmd)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user