refactor: export HasRegisterServices (#23488)

This commit is contained in:
Alex | Interchain Labs
2025-01-23 21:01:19 +00:00
committed by GitHub
parent 1253ee5fef
commit 8493d4fdcb
6 changed files with 68 additions and 71 deletions
+2 -9
View File
@@ -8,7 +8,6 @@ import (
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1"
cmtcrypto "github.com/cometbft/cometbft/crypto"
cmted25519 "github.com/cometbft/cometbft/crypto/ed25519"
"google.golang.org/grpc"
runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
"cosmossdk.io/core/appmodule"
@@ -80,8 +79,8 @@ func (a *App) RegisterModules(modules ...module.AppModule) error {
if mod, ok := appModule.(module.HasServices); ok {
mod.RegisterServices(a.configurator)
} else if module, ok := appModule.(hasServicesV1); ok {
if err := module.RegisterServices(a.configurator); err != nil {
} else if mod, ok := appModule.(module.HasRegisterServices); ok {
if err := mod.RegisterServices(a.configurator); err != nil {
return err
}
}
@@ -267,12 +266,6 @@ func (a *App) UnsafeFindStoreKey(storeKey string) storetypes.StoreKey {
return a.storeKeys[i]
}
// hasServicesV1 is the interface for registering service in baseapp Cosmos SDK.
// This API is part of core/appmodule but commented out for dependencies.
type hasServicesV1 interface {
RegisterServices(grpc.ServiceRegistrar) error
}
// ValidatorKeyProvider returns a function that generates a private key for use by comet.
func (a *App) ValidatorKeyProvider() KeyGenF {
return func() (cmtcrypto.PrivKey, error) {