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

feat: add query local min-gas-price (backport #2627) #2637

Merged
merged 2 commits into from
Jul 3, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- register NodeService to enable query /cosmos/base/node/v1beta1/config
gRPC query to disclose node operator's configured minimum-gas-price.
([\#2629](https://github.com/cosmos/gaia/issues/2629))
8 changes: 8 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -342,6 +343,8 @@ func (app *GaiaApp) SimulationManager() *module.SimulationManager {
func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
rpc.RegisterRoutes(clientCtx, apiSvr.Router)

nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register legacy tx routes.
authrest.RegisterTxRoutes(clientCtx, apiSvr.Router)
// Register new tx routes from grpc-gateway.
Expand All @@ -359,6 +362,11 @@ func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo
}
}

// RegisterTxService allows query minimum-gas-prices in app.toml
func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) {
nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter())
}

// RegisterTxService implements the Application.RegisterTxService method.
func (app *GaiaApp) RegisterTxService(clientCtx client.Context) {
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
Expand Down
1 change: 0 additions & 1 deletion docs/hub-overview/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ These block explorers allow you to search, view and analyze Cosmos Hub data&mdas
* [Big Dipper](https://cosmos.bigdipper.live)
* [Cosmos Overview](https://genesislab.net)
* [Cosmoscan](https://cosmoscan.net/)
* [Cosmos Visualizer](https://nylira.net/3d)
* [IOBScan](https://cosmoshub.iobscan.io/)
* [LOOK Explorer](https://cosmos.ping.pub)
* [Lunie](https://lunie.io)
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/e2e_rest_regression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const (
slashingParamsModuleQueryPath = "/slashing/parameters"
stakingParamsModuleQueryPath = "/staking/parameters"
missingPath = "/missing_endpoint"
localMinGasPriceQueryPath = "/cosmos/base/node/v1beta1/config"
)

func (s *IntegrationTestSuite) testRestInterfaces() {
Expand Down Expand Up @@ -73,6 +74,8 @@ func (s *IntegrationTestSuite) testRestInterfaces() {
{slashingParamsModuleQueryPath, 200},
{stakingParamsModuleQueryPath, 200},
{missingPath, 501},
// node config Endpoint
{localMinGasPriceQueryPath, 200},
}
)

Expand Down
Loading