refactor(x): update to latest core (partial backport #21166) (#21214)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2024-08-08 08:28:19 +00:00
committed by GitHub
co-authored by Julien Robert
parent 27cd8ed9f9
commit f5b4c23ec3
75 changed files with 109 additions and 103 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ func (c coreAppModuleAdaptor) RegisterLegacyAminoCodec(amino legacy.Amino) {
// RegisterServices implements HasServices
func (c coreAppModuleAdaptor) RegisterServices(cfg Configurator) {
if module, ok := c.module.(appmodule.HasServices); ok {
if module, ok := c.module.(hasServicesV1); ok {
err := module.RegisterServices(cfg)
if err != nil {
panic(err)
+10 -1
View File
@@ -30,6 +30,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"golang.org/x/exp/maps"
"google.golang.org/grpc"
"cosmossdk.io/core/appmodule"
appmodulev2 "cosmossdk.io/core/appmodule/v2"
@@ -92,6 +93,14 @@ type HasServices interface {
RegisterServices(Configurator)
}
// 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 {
appmodule.AppModule
RegisterServices(grpc.ServiceRegistrar) error
}
// MigrationHandler is the migration function that each module registers.
type MigrationHandler func(sdk.Context) error
@@ -383,7 +392,7 @@ func (m *Manager) RegisterServices(cfg Configurator) error {
module.RegisterServices(cfg)
}
if module, ok := module.(appmodule.HasServices); ok {
if module, ok := module.(hasServicesV1); ok {
err := module.RegisterServices(cfg)
if err != nil {
return err
-1
View File
@@ -577,5 +577,4 @@ func (MockCoreAppModule) ExportGenesis(ctx context.Context, target appmodule.Gen
var (
_ appmodule.AppModule = MockCoreAppModule{}
_ appmodule.HasGenesisAuto = MockCoreAppModule{}
_ appmodule.HasServices = MockCoreAppModule{}
)