Skip to content

Commit

Permalink
meh
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 18, 2024
1 parent 5bbd256 commit f33fe9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1"
"cosmossdk.io/core/server"
"cosmossdk.io/core/transaction"
errorsmod "cosmossdk.io/errors/v2"

Expand All @@ -28,11 +29,12 @@ import (
// Eventually, they will be removed in favor of the new gRPC services.
func (c *Consensus[T]) GRPCServiceRegistrar(
clientCtx client.Context,
cfg server.ConfigMap,
) func(srv *grpc.Server) error {
return func(srv *grpc.Server) error {
cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(clientCtx.Client, c.Query, clientCtx.ConsensusAddressCodec))
txtypes.RegisterServiceServer(srv, txServer[T]{clientCtx, c})
nodeservice.RegisterServiceServer(srv, nodeServer[T]{c})
nodeservice.RegisterServiceServer(srv, nodeServer[T]{cfg, c})

return nil
}
Expand Down Expand Up @@ -185,12 +187,19 @@ func (t txServer[T]) TxEncodeAmino(context.Context, *txtypes.TxEncodeAminoReques
var _ txtypes.ServiceServer = txServer[transaction.Tx]{}

type nodeServer[T transaction.Tx] struct {
cfg server.ConfigMap
consensus *Consensus[T]
}

func (s nodeServer[T]) Config(ctx context.Context, _ *nodeservice.ConfigRequest) (*nodeservice.ConfigResponse, error) {
minGasPricesStr := ""
minGasPrices, ok := s.cfg["server"].(map[string]interface{})["minimum-gas-prices"]
if ok {
minGasPricesStr = minGasPrices.(string)
}

return &nodeservice.ConfigResponse{
MinimumGasPrice: "check cosmos.base.v2.Service/Config",
MinimumGasPrice: minGasPricesStr,
PruningKeepRecent: "ambiguous in v2",
PruningInterval: "ambiguous in v2",
HaltHeight: s.consensus.cfg.AppTomlConfig.HaltHeight,
Expand Down
1 change: 1 addition & 0 deletions simapp/v2/simdv2/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func InitRootCmd[T transaction.Tx](
[]func(*grpc.Server) error{
deps.ConsensusServer.Consensus.GRPCServiceRegistrar(
deps.ClientContext,
deps.GlobalConfig,
),
},
deps.GlobalConfig,
Expand Down

0 comments on commit f33fe9e

Please sign in to comment.