feat: gRPC query for operator and chain configuration (#13485)
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
|
||||
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
@@ -465,6 +466,7 @@ func NewSimApp(
|
||||
app.SetBeginBlocker(app.BeginBlocker)
|
||||
app.SetEndBlocker(app.EndBlocker)
|
||||
app.setAnteHandler(encodingConfig.TxConfig)
|
||||
|
||||
// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
|
||||
// antehandlers, but are run _after_ the `runMsgs` execution. They are also
|
||||
// defined as a chain, and have the same signature as antehandlers.
|
||||
@@ -621,9 +623,13 @@ func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICon
|
||||
clientCtx := apiSvr.ClientCtx
|
||||
// Register new tx routes from grpc-gateway.
|
||||
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
|
||||
|
||||
// Register new tendermint queries routes from grpc-gateway.
|
||||
tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
|
||||
|
||||
// Register node gRPC service for grpc-gateway.
|
||||
nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
|
||||
|
||||
// Register grpc-gateway routes for all modules.
|
||||
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
|
||||
|
||||
@@ -648,6 +654,10 @@ func (app *SimApp) RegisterTendermintService(clientCtx client.Context) {
|
||||
)
|
||||
}
|
||||
|
||||
func (app *SimApp) RegisterNodeService(clientCtx client.Context) {
|
||||
nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter())
|
||||
}
|
||||
|
||||
// GetMaccPerms returns a copy of the module account permissions
|
||||
//
|
||||
// NOTE: This is solely to be used for testing purposes.
|
||||
|
||||
Reference in New Issue
Block a user