From 5fafc10e03d0dbc16d57a1bea974056a8603030a Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Wed, 4 Dec 2024 15:31:58 +0700 Subject: [PATCH 1/2] use hybrid resolver instead of GlobalFiles --- runtime/v2/manager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index 18b6587e86a4..7c0305d1badb 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -14,7 +14,6 @@ import ( "google.golang.org/grpc" proto "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" runtimev2 "cosmossdk.io/api/cosmos/app/runtime/v2" cosmosmsg "cosmossdk.io/api/cosmos/msg/v1" @@ -485,7 +484,7 @@ func (m *MM[T]) RunMigrations(ctx context.Context, fromVM appmodulev2.VersionMap func (m *MM[T]) RegisterServices(app *App[T]) error { for _, module := range m.modules { // register msg + query - if err := registerServices(module, app, protoregistry.GlobalFiles); err != nil { + if err := registerServices(module, app, gogoproto.HybridResolver); err != nil { return err } @@ -618,7 +617,7 @@ func (m *MM[T]) assertNoForgottenModules( return nil } -func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], registry *protoregistry.Files) error { +func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], registry gogoproto.Resolver) error { // case module with services if services, ok := s.(hasServicesV1); ok { c := &configurator{ @@ -671,7 +670,7 @@ type configurator struct { stfQueryRouter *stf.MsgRouterBuilder stfMsgRouter *stf.MsgRouterBuilder - registry *protoregistry.Files + registry gogoproto.Resolver err error } From ae4249f6372c8a8a85f026f8ecb72ded87d55456 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Wed, 4 Dec 2024 15:32:30 +0700 Subject: [PATCH 2/2] no need --- x/accounts/module.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/x/accounts/module.go b/x/accounts/module.go index daadebfe91ce..f7958240b7b5 100644 --- a/x/accounts/module.go +++ b/x/accounts/module.go @@ -8,7 +8,6 @@ import ( "google.golang.org/grpc" "cosmossdk.io/core/appmodule" - appmodulev2 "cosmossdk.io/core/appmodule/v2" "cosmossdk.io/core/registry" "cosmossdk.io/x/accounts/cli" v1 "cosmossdk.io/x/accounts/v1" @@ -62,25 +61,6 @@ func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { return nil } -// RegisterQueryHandlers registers the query handlers for the accounts module. -func (am AppModule) RegisterQueryHandlers(router appmodulev2.QueryRouter) { - queryServer := NewQueryServer(am.k) - - appmodulev2.RegisterMsgHandler(router, queryServer.AccountNumber) - appmodulev2.RegisterMsgHandler(router, queryServer.AccountQuery) - appmodulev2.RegisterMsgHandler(router, queryServer.AccountType) - appmodulev2.RegisterMsgHandler(router, queryServer.Schema) -} - -// RegisterMsgHandlers registers the message handlers for the accounts module. -func (am AppModule) RegisterMsgHandlers(router appmodulev2.MsgRouter) { - msgServer := NewMsgServer(am.k) - - appmodulev2.RegisterMsgHandler(router, msgServer.Execute) - appmodulev2.RegisterMsgHandler(router, msgServer.ExecuteBundle) - appmodulev2.RegisterMsgHandler(router, msgServer.Init) -} - // App module genesis func (am AppModule) DefaultGenesis() json.RawMessage {