refactor(server/v2/cometbft): add codec.Codec and clean-up APIs (#22566)

This commit is contained in:
Julien Robert
2024-11-20 15:52:18 +00:00
committed by GitHub
parent d810b77c71
commit efc05e8122
11 changed files with 174 additions and 147 deletions
+5 -4
View File
@@ -40,7 +40,7 @@ type CommandDependencies[T transaction.Tx] struct {
TxConfig client.TxConfig
ModuleManager *runtimev2.MM[T]
SimApp *simapp.SimApp[T]
// could be more generic with serverv2.ServerComponent[T]
// could generally be more generic with serverv2.ServerComponent[T]
// however, we want to register extra grpc handlers
ConsensusServer *cometbft.CometBFTServer[T]
ClientContext client.Context
@@ -106,11 +106,12 @@ func InitRootCmd[T transaction.Tx](
simApp.Name(),
simApp.Store(),
simApp.App.AppManager,
simApp.AppCodec(),
&genericTxDecoder[T]{deps.TxConfig},
simApp.App.QueryHandlers(),
simApp.App.SchemaDecoderResolver(),
&genericTxDecoder[T]{deps.TxConfig},
deps.GlobalConfig,
initCometOptions[T](),
deps.GlobalConfig,
)
if err != nil {
return nil, err
@@ -129,7 +130,7 @@ func InitRootCmd[T transaction.Tx](
simApp.Query,
deps.GlobalConfig,
grpcserver.WithExtraGRPCHandlers[T](
deps.ConsensusServer.Consensus.GRPCServiceRegistrar(
deps.ConsensusServer.GRPCServiceRegistrar(
deps.ClientContext,
deps.GlobalConfig,
),