Skip to content

Commit

Permalink
fix: register gRPC Gateway routes (#2838)
Browse files Browse the repository at this point in the history
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
-->
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

<!--
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [ ] 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 b75c7e3)
  • Loading branch information
jaybxyz authored and mergify[bot] committed Nov 14, 2023
1 parent 8e779fa commit 753acb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion x/blob/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package blob

import (
"context"
"encoding/json"
"fmt"

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion x/qgb/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package qgb

import (
"context"
"encoding/json"
"fmt"

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 753acb5

Please sign in to comment.