Skip to content

Commit

Permalink
added tax/info endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
scottburch committed Jan 7, 2021
1 parent 5b6bed3 commit 3ea604e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions x/tax/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import (

"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/gorilla/mux"
)

func QueryTaxInfoHandler(cliCtx context.CLIContext, storeName string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)

res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/read/%s/%s", storeName, vars["UUID"], vars["key"]), nil)
res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/info", storeName), nil)
if err != nil {
rest.WriteErrorResponse(w, http.StatusNotFound, err.Error())
return
Expand Down
2 changes: 1 addition & 1 deletion x/tax/client/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// RegisterRoutes - Central function to define routes that get registered by the main application
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, storeName string) {
r.HandleFunc(fmt.Sprintf("/%s/into", storeName), QueryTaxInfoHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/info", storeName), QueryTaxInfoHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/bp", storeName), SetBpHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/collector", storeName), SetCollectorHandler(cliCtx)).Methods("POST")
}
2 changes: 1 addition & 1 deletion x/tax/internal/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// constants
const (
QueryTaxInfo = "tax_info"
QueryTaxInfo = "info"
)

// NewQuerier helps querying
Expand Down

0 comments on commit 3ea604e

Please sign in to comment.