cosmos-sdk/x/evidence/client/rest/rest.go
SaReN 39f53ac22f
client: rename CliContext to Context (#6290)
* Refactor CliContext as Context

* Fix lint issues

* Fix goimports

* Fix gov tests

* Resolved ci-lint issues

* Add changelog

* Rename cliCtx to clientCtx

* Fix mocks and routes

* Add changelog

* Update changelog

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* merge client/rpc/ro{ot,utes}.go

* Update docs

* client/rpc: remove redundant client/rpc.RegisterRPCRoutes

* regenerate mocks

* Update ADRs

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-01 12:46:03 +00:00

31 lines
755 B
Go

package rest
import (
"net/http"
"github.com/cosmos/cosmos-sdk/client"
"github.com/gorilla/mux"
)
// REST query and parameter values
const (
RestParamEvidenceHash = "evidence-hash"
MethodGet = "GET"
)
// EvidenceRESTHandler defines a REST service evidence handler implemented in
// another module. The sub-route is mounted on the evidence REST handler.
type EvidenceRESTHandler struct {
SubRoute string
Handler func(http.ResponseWriter, *http.Request)
}
// RegisterRoutes registers all Evidence submission handlers for the evidence module's
// REST service handler.
func RegisterRoutes(clientCtx client.Context, r *mux.Router, handlers []EvidenceRESTHandler) {
registerQueryRoutes(clientCtx, r)
registerTxRoutes(clientCtx, r, handlers)
}