Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove legacy REST API routes #123

Merged
merged 3 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,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