Skip to content

Commit

Permalink
refactor: remove legacy REST API routes (#123)
Browse files Browse the repository at this point in the history
* refactor: remove legacy REST API routes

* update CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Youngtaek Yoon <[email protected]>

Co-authored-by: Youngtaek Yoon <[email protected]>
  • Loading branch information
tkxkd0159 and 0Tech authored Jan 11, 2023
1 parent cd91714 commit a86e560
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

### Improvements

### Breaking Changes
(api) [\#123](https://github.com/line/lbm/pull/123) remove legacy REST API routes

### Build, CI

Expand Down
11 changes: 3 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package app

import (
"fmt"

"io"
stdlog "log"
"net/http"
Expand All @@ -23,7 +22,6 @@ import (
"github.com/line/lbm-sdk/client"
nodeservice "github.com/line/lbm-sdk/client/grpc/node"
"github.com/line/lbm-sdk/client/grpc/tmservice"
"github.com/line/lbm-sdk/client/rpc"
"github.com/line/lbm-sdk/codec"
"github.com/line/lbm-sdk/codec/types"
"github.com/line/lbm-sdk/server/api"
Expand All @@ -36,7 +34,6 @@ import (
"github.com/line/lbm-sdk/version"
"github.com/line/lbm-sdk/x/auth"
"github.com/line/lbm-sdk/x/auth/ante"
authrest "github.com/line/lbm-sdk/x/auth/client/rest"
authkeeper "github.com/line/lbm-sdk/x/auth/keeper"
authsims "github.com/line/lbm-sdk/x/auth/simulation"
authtx "github.com/line/lbm-sdk/x/auth/tx"
Expand Down Expand Up @@ -97,6 +94,7 @@ import (
wasmclient "github.com/line/lbm-sdk/x/wasm/client"
wasmkeeper "github.com/line/lbm-sdk/x/wasm/keeper"
wasmlbmtypes "github.com/line/lbm-sdk/x/wasm/lbmtypes"

appparams "github.com/line/lbm/app/params"

// unnamed import of statik for swagger UI support
Expand Down Expand Up @@ -672,9 +670,7 @@ func (app *LinkApp) SimulationManager() *module.SimulationManager {
// API server.
func (app *LinkApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
rpc.RegisterRoutes(clientCtx, apiSvr.Router)
// Register legacy tx routes.
authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)

// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register new tendermint queries routes from grpc-gateway.
Expand All @@ -683,8 +679,7 @@ func (app *LinkApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo
// Register node gRPC service for grpc-gateway.
nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register legacy and grpc-gateway routes for all modules.
ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
// Register grpc-gateway routes for all modules.
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register swagger API from root so that other applications can override easily
Expand Down

0 comments on commit a86e560

Please sign in to comment.