From 753acb5631e4908de99eb8a3d648c92787a4129a Mon Sep 17 00:00:00 2001 From: JayB Date: Tue, 14 Nov 2023 20:54:59 +0900 Subject: [PATCH] fix: register gRPC Gateway routes (#2838) ## Overview This PR fixes #2837. Both `blob` and `blobstream` modules lack registration for the gRPC Gateway routes, leading to the inability to query endpoints. Let me know if there is anything i need to do to merge this PR. CI checks require 3 workflows awaiting approval. ## Checklist - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords (cherry picked from commit b75c7e3b80f91efae1164e8889bed9dd2c96414f) --- x/blob/module.go | 6 +++++- x/qgb/module.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/x/blob/module.go b/x/blob/module.go index 74f1c06bf0..eaa8612894 100644 --- a/x/blob/module.go +++ b/x/blob/module.go @@ -1,6 +1,7 @@ package blob import ( + "context" "encoding/json" "fmt" @@ -75,7 +76,10 @@ func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) { +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } } // GetTxCmd returns the capability module's root tx command. diff --git a/x/qgb/module.go b/x/qgb/module.go index 8d2035d13e..8c844e0c3c 100644 --- a/x/qgb/module.go +++ b/x/qgb/module.go @@ -1,6 +1,7 @@ package qgb import ( + "context" "encoding/json" "fmt" @@ -76,7 +77,10 @@ func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) { +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } } // GetTxCmd returns the capability module's root tx command.