From a86e560a0d43070305c6d1cb46922e64251c096f Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:10:57 +0900 Subject: [PATCH] refactor: remove legacy REST API routes (#123) * refactor: remove legacy REST API routes * update CHANGELOG * Update CHANGELOG.md Co-authored-by: Youngtaek Yoon Co-authored-by: Youngtaek Yoon --- CHANGELOG.md | 3 +-- app/app.go | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5e9829..ead2941f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/app.go b/app/app.go index b86350ce..a2df62ad 100644 --- a/app/app.go +++ b/app/app.go @@ -2,7 +2,6 @@ package app import ( "fmt" - "io" stdlog "log" "net/http" @@ -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" @@ -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" @@ -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 @@ -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. @@ -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