forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove legacy REST endpoints for broadcast & encode (v0.44.x) (c…
…osmos#10041) * fix: remove legacy REST endpoints for broadcast & encode * add changelog * update changelog * fix amino tx marshaling test * try to fix x/auth/client/rest tests * changing tx broadcast request type * remove auth client/rest_test.go Co-authored-by: Robert Zaremba <robert@zaremba.ch>
- Loading branch information
1 parent
97c27e9
commit 0ca32ca
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package rest | ||
|
||
import ( | ||
"github.com/gorilla/mux" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/rest" | ||
) | ||
|
||
// REST query and parameter values | ||
const ( | ||
MethodGet = "GET" | ||
) | ||
|
||
// RegisterRoutes registers the auth module REST routes. | ||
func RegisterRoutes(clientCtx client.Context, rtr *mux.Router, storeName string) { | ||
r := rest.WithHTTPDeprecationHeaders(rtr) | ||
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, rtr *mux.Router) { | ||
r := rest.WithHTTPDeprecationHeaders(rtr) | ||
r.HandleFunc("/txs/{hash}", QueryTxRequestHandlerFn(clientCtx)).Methods("GET") | ||
r.HandleFunc("/txs", QueryTxsRequestHandlerFn(clientCtx)).Methods("GET") | ||
r.HandleFunc("/txs/decode", DecodeTxRequestHandlerFn(clientCtx)).Methods("POST") | ||
} |