Skip to content

Commit

Permalink
fix: tx msgServer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepan95dev committed Feb 21, 2024
1 parent 23aca74 commit 44874df
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ func New(
bApp.SetVersion(version.Version)
bApp.SetProtocolVersion(ProtocolVersion)
bApp.SetInterfaceRegistry(interfaceRegistry)
bApp.SetTxEncoder(txConfig.TxEncoder())

keys := sdk.NewKVStoreKeys(
authtypes.StoreKey,
Expand Down Expand Up @@ -355,7 +356,6 @@ func New(
BlockedAddresses(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.AuthzKeeper = authzkeeper.NewKeeper(
keys[authzkeeper.StoreKey],
appCodec,
Expand Down
7 changes: 7 additions & 0 deletions x/did/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ type MsgServer struct {
Keeper
}

// NewMsgServerImpl returns an implementation of the x/auth MsgServer interface.
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
return &MsgServer{
keeper,
}
}

// NewMsgServer returns an implementation of the MsgServer interface for the provided Keeper.
func NewMsgServer(keeper Keeper) types.MsgServer {
return &MsgServer{Keeper: keeper}
Expand Down
1 change: 1 addition & 0 deletions x/did/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (am AppModule) Name() string {
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
}

// RegisterInvariants registers the cheqd module's invariants.
Expand Down
7 changes: 7 additions & 0 deletions x/resource/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ type msgServer struct {
didKeeper didkeeper.Keeper
}

// NewMsgServerImpl returns an implementation of the x/auth MsgServer interface.
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
return &msgServer{
Keeper: keeper,
}
}

// NewMsgServer returns an implementation of the MsgServer interface for the provided Keeper.
func NewMsgServer(keeper Keeper, cheqdKeeper didkeeper.Keeper) types.MsgServer {
return &msgServer{
Expand Down
2 changes: 1 addition & 1 deletion x/resource/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (am AppModule) Name() string {
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServer(am.keeper, am.didKeeper))

types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
// Register for migration from consensus version 2 -> 3
migratorV3 := migrationV3.NewMigrator(am.keeper)
if err := cfg.RegisterMigration(types.ModuleName, 2, migratorV3.Migrate2to3); err != nil {
Expand Down

0 comments on commit 44874df

Please sign in to comment.