From c42775f9cf7839e659b9b1f995f72f78d7e37627 Mon Sep 17 00:00:00 2001 From: Mohammed Affan Date: Mon, 14 Oct 2024 14:29:44 -0400 Subject: [PATCH] [OTE-852] Register rpc routes in module (#2480) (cherry picked from commit d1ac09bedb3fc8b0e0ea35b9215a9b02cd483660) --- protocol/x/revshare/module.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/protocol/x/revshare/module.go b/protocol/x/revshare/module.go index 460b204145..707347597a 100644 --- a/protocol/x/revshare/module.go +++ b/protocol/x/revshare/module.go @@ -1,6 +1,7 @@ package revshare import ( + "context" "encoding/json" "fmt" @@ -75,7 +76,12 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err != nil { + panic(err) + } +} // GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to // generate new transactions containing messages defined in the module.