diff --git a/cmd/dncli/docs/swagger.go b/cmd/dncli/docs/swagger.go index ca5c16b1..a00fa4d7 100644 --- a/cmd/dncli/docs/swagger.go +++ b/cmd/dncli/docs/swagger.go @@ -5671,7 +5671,7 @@ paths: tags: - Tendermint RPC /vm/compile: - get: + post: consumes: - application/json description: Compile script / module code using VM and return byteCode diff --git a/helpers/tests/clitester/cli_tester_rest.go b/helpers/tests/clitester/cli_tester_rest.go index cafc3b20..cba9c5b4 100644 --- a/helpers/tests/clitester/cli_tester_rest.go +++ b/helpers/tests/clitester/cli_tester_rest.go @@ -388,7 +388,7 @@ func (ct *CLITester) RestQueryVMCompile(address, code string) (*RestRequest, *vm reqSubPath := fmt.Sprintf("%s/%s", vm.ModuleName, "compile") respMsg := &vm_client.CompiledItems{} - r := ct.newRestRequest().SetQuery("GET", reqSubPath, nil, req, respMsg) + r := ct.newRestRequest().SetQuery("POST", reqSubPath, nil, req, respMsg) return r, respMsg } diff --git a/x/vm/client/rest/rest.go b/x/vm/client/rest/rest.go index 4ca27957..d280a79a 100644 --- a/x/vm/client/rest/rest.go +++ b/x/vm/client/rest/rest.go @@ -63,7 +63,7 @@ type LcsViewResp struct { // Registering routes for REST API. func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) { - r.HandleFunc(fmt.Sprintf("/%s/compile", types.ModuleName), compile(cliCtx)).Methods("GET") + r.HandleFunc(fmt.Sprintf("/%s/compile", types.ModuleName), compile(cliCtx)).Methods("POST") r.HandleFunc(fmt.Sprintf("/%s/data/{%s}/{%s}", types.ModuleName, accountAddrName, vmPathName), getData(cliCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/%s/view", types.ModuleName), lcsView(cliCtx)).Methods("GET") r.HandleFunc(fmt.Sprintf("/%s/tx/{%s}", types.ModuleName, txHash), getTxVMStatus(cliCtx)).Methods("GET") @@ -82,7 +82,7 @@ func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) { // @Success 200 {object} VmRespCompile // @Failure 400 {object} rest.ErrorResponse "Returned if the request doesn't have valid query params" // @Failure 500 {object} rest.ErrorResponse "Returned on server error" -// @Router /vm/compile [get] +// @Router /vm/compile [post] func compile(cliCtx context.CLIContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { compilerAddr := viper.GetString(vm_client.FlagCompilerAddr)