Rename remaining {Init,Migrate}Msg fields

This commit is contained in:
Ethan Frey
2021-07-27 09:38:30 +02:00
parent 699fbbc215
commit 6c7bb96511
4 changed files with 21 additions and 21 deletions

View File

@@ -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,
}
}

View File

@@ -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())

View File

@@ -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,
}

View File

@@ -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
}