* 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>
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
package rest
|
|
|
|
import (
|
|
"github.com/gorilla/mux"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
)
|
|
|
|
// REST query and parameter values
|
|
const (
|
|
MethodGet = "GET"
|
|
)
|
|
|
|
// RegisterRoutes registers the auth module REST routes.
|
|
func RegisterRoutes(clientCtx client.Context, r *mux.Router, storeName string) {
|
|
r.HandleFunc(
|
|
"/auth/accounts/{address}", QueryAccountRequestHandlerFn(storeName, clientCtx),
|
|
).Methods(MethodGet)
|
|
|
|
r.HandleFunc(
|
|
"/auth/params",
|
|
queryParamsHandler(clientCtx),
|
|
).Methods(MethodGet)
|
|
}
|
|
|
|
// RegisterTxRoutes registers all transaction routes on the provided router.
|
|
func RegisterTxRoutes(clientCtx client.Context, r *mux.Router) {
|
|
r.HandleFunc("/txs/{hash}", QueryTxRequestHandlerFn(clientCtx)).Methods("GET")
|
|
r.HandleFunc("/txs", QueryTxsRequestHandlerFn(clientCtx)).Methods("GET")
|
|
r.HandleFunc("/txs", BroadcastTxRequest(clientCtx)).Methods("POST")
|
|
r.HandleFunc("/txs/encode", EncodeTxRequestHandlerFn(clientCtx)).Methods("POST")
|
|
r.HandleFunc("/txs/decode", DecodeTxRequestHandlerFn(clientCtx)).Methods("POST")
|
|
}
|