Skip to content

Commit

Permalink
add deprecation headers to custom rest handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
yun-yeo committed May 26, 2021
1 parent 5ac5439 commit c8c8f9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion custom/auth/client/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
"github.com/gorilla/mux"

"github.com/cosmos/cosmos-sdk/client"
clientrest "github.com/cosmos/cosmos-sdk/client/rest"
)

// RegisterTxRoutes registers registers terra custom transaction routes on the provided router.
func RegisterTxRoutes(clientCtx client.Context, rtr *mux.Router) {
rtr.HandleFunc("/txs/estimate_fee", EstimateTxFeeRequestHandlerFn(clientCtx)).Methods("POST")
r := clientrest.WithHTTPDeprecationHeaders(rtr)
r.HandleFunc("/txs/estimate_fee", EstimateTxFeeRequestHandlerFn(clientCtx)).Methods("POST")
}
4 changes: 2 additions & 2 deletions custom/bank/client/rest/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
func RegisterRoutes(clientCtx client.Context, rtr *mux.Router) {
r := clientrest.WithHTTPDeprecationHeaders(rtr)

rtr.HandleFunc("/bank/accounts/{address}/transfers", sendRequestHandlerFn(clientCtx)).Methods("POST")
bankrest.RegisterHandlers(clientCtx, r)
r.HandleFunc("/bank/accounts/{address}/transfers", sendRequestHandlerFn(clientCtx)).Methods("POST")
bankrest.RegisterHandlers(clientCtx, rtr)
}

// SendReq defines the properties of a send request's body.
Expand Down

0 comments on commit c8c8f9e

Please sign in to comment.