Rename remaining {Init,Migrate}Msg fields
This commit is contained in:
@@ -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"`
|
||||
Funds sdk.Coins `json:"funds" yaml:"funds"`
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
Code uint64 `json:"code_id" yaml:"code_id"`
|
||||
Label string `json:"label" yaml:"label"`
|
||||
Msg json.RawMessage `json:"msg" yaml:"init_msg"`
|
||||
Funds sdk.Coins `json:"funds" yaml:"funds"`
|
||||
}
|
||||
|
||||
func (s InstantiateProposalJsonReq) Content() govtypes.Content {
|
||||
@@ -92,7 +92,7 @@ func (s InstantiateProposalJsonReq) Content() govtypes.Content {
|
||||
Admin: s.Admin,
|
||||
CodeID: s.Code,
|
||||
Label: s.Label,
|
||||
Msg: s.InitMsg,
|
||||
Msg: s.Msg,
|
||||
Funds: s.Funds,
|
||||
}
|
||||
}
|
||||
@@ -128,9 +128,9 @@ type MigrateProposalJsonReq struct {
|
||||
Proposer string `json:"proposer" yaml:"proposer"`
|
||||
Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
|
||||
|
||||
Contract string `json:"contract" yaml:"contract"`
|
||||
Code uint64 `json:"code_id" yaml:"code_id"`
|
||||
MigrateMsg json.RawMessage `json:"msg" yaml:"msg"`
|
||||
Contract string `json:"contract" yaml:"contract"`
|
||||
Code uint64 `json:"code_id" yaml:"code_id"`
|
||||
Msg json.RawMessage `json:"msg" yaml:"msg"`
|
||||
// RunAs is the role that is passed to the contract's environment
|
||||
RunAs string `json:"run_as" yaml:"run_as"`
|
||||
}
|
||||
@@ -141,7 +141,7 @@ func (s MigrateProposalJsonReq) Content() govtypes.Content {
|
||||
Description: s.Description,
|
||||
Contract: s.Contract,
|
||||
CodeID: s.Code,
|
||||
Msg: s.MigrateMsg,
|
||||
Msg: s.Msg,
|
||||
RunAs: s.RunAs,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ func registerNewTxRoutes(cliCtx client.Context, r *mux.Router) {
|
||||
}
|
||||
|
||||
type migrateContractReq struct {
|
||||
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
CodeID uint64 `json:"code_id" yaml:"code_id"`
|
||||
MigrateMsg []byte `json:"migrate_msg,omitempty" yaml:"migrate_msg"`
|
||||
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
CodeID uint64 `json:"code_id" yaml:"code_id"`
|
||||
Msg []byte `json:"msg,omitempty" yaml:"migrate_msg"`
|
||||
}
|
||||
|
||||
type updateContractAdministrateReq struct {
|
||||
@@ -73,7 +73,7 @@ func migrateContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
|
||||
Sender: req.BaseReq.From,
|
||||
Contract: contractAddr,
|
||||
CodeID: req.CodeID,
|
||||
Msg: req.MigrateMsg,
|
||||
Msg: req.Msg,
|
||||
}
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
|
||||
|
||||
@@ -29,7 +29,7 @@ type instantiateContractReq struct {
|
||||
Label string `json:"label" yaml:"label"`
|
||||
Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
|
||||
Admin string `json:"admin,omitempty" yaml:"admin"`
|
||||
InitMsg []byte `json:"init_msg" yaml:"init_msg"`
|
||||
Msg []byte `json:"msg" yaml:"init_msg"`
|
||||
}
|
||||
|
||||
type executeContractReq struct {
|
||||
@@ -105,7 +105,7 @@ func instantiateContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
|
||||
CodeID: codeID,
|
||||
Label: req.Label,
|
||||
Funds: req.Deposit,
|
||||
Msg: req.InitMsg,
|
||||
Msg: req.Msg,
|
||||
Admin: req.Admin,
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) {
|
||||
Admin string `yaml:"admin"`
|
||||
CodeID uint64 `yaml:"code_id"`
|
||||
Label string `yaml:"label"`
|
||||
InitMsg string `yaml:"init_msg"`
|
||||
Msg string `yaml:"msg"`
|
||||
Funds sdk.Coins `yaml:"funds"`
|
||||
}{
|
||||
Title: p.Title,
|
||||
@@ -224,7 +224,7 @@ func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) {
|
||||
Admin: p.Admin,
|
||||
CodeID: p.CodeID,
|
||||
Label: p.Label,
|
||||
InitMsg: string(p.Msg),
|
||||
Msg: string(p.Msg),
|
||||
Funds: p.Funds,
|
||||
}, nil
|
||||
}
|
||||
@@ -280,14 +280,14 @@ func (p MigrateContractProposal) MarshalYAML() (interface{}, error) {
|
||||
Description string `yaml:"description"`
|
||||
Contract string `yaml:"contract"`
|
||||
CodeID uint64 `yaml:"code_id"`
|
||||
MigrateMsg string `yaml:"msg"`
|
||||
Msg string `yaml:"msg"`
|
||||
RunAs string `yaml:"run_as"`
|
||||
}{
|
||||
Title: p.Title,
|
||||
Description: p.Description,
|
||||
Contract: p.Contract,
|
||||
CodeID: p.CodeID,
|
||||
MigrateMsg: string(p.Msg),
|
||||
Msg: string(p.Msg),
|
||||
RunAs: p.RunAs,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user