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: Amend #13497 #13577

Merged
merged 2 commits into from Oct 18, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/start.go
Expand Up @@ -334,7 +334,10 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App

app.RegisterTxService(clientCtx)
app.RegisterTendermintService(clientCtx)
app.RegisterNodeService(clientCtx)

if a, ok := app.(types.ApplicationQueryService); ok {
a.RegisterNodeService(clientCtx)
}
}

metrics, err := startTelemetry(config)
Expand Down
13 changes: 10 additions & 3 deletions server/types/app.go
Expand Up @@ -53,13 +53,20 @@ type (
// RegisterTendermintService registers the gRPC Query service for tendermint queries.
RegisterTendermintService(client.Context)

// RegisterNodeService registers the node gRPC Query service.
RegisterNodeService(client.Context)

// Return the multistore instance
CommitMultiStore() sdk.CommitMultiStore
}

// ApplicationQueryService defines an extension of the Application interface
// that facilitates gRPC query Services.
//
// NOTE: This interfaces exists only in the v0.46.x line to ensure the existing
// Application interface does not introduce API breaking changes.
ApplicationQueryService interface {
// RegisterNodeService registers the node gRPC Query service.
RegisterNodeService(client.Context)
}

// AppCreator is a function that allows us to lazily initialize an
// application using various configurations.
AppCreator func(log.Logger, dbm.DB, io.Writer, AppOptions) Application
Expand Down
5 changes: 4 additions & 1 deletion testutil/network/util.go
Expand Up @@ -72,7 +72,10 @@ func startInProcess(cfg Config, val *Validator) error {

app.RegisterTxService(val.ClientCtx)
app.RegisterTendermintService(val.ClientCtx)
app.RegisterNodeService(val.ClientCtx)

if a, ok := app.(srvtypes.ApplicationQueryService); ok {
a.RegisterNodeService(val.ClientCtx)
}
}

if val.APIAddress != "" {
Expand Down