Skip to content

Commit

Permalink
update with address.Codec
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Jan 14, 2025
1 parent b5245d9 commit 89094ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/psm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer {
var _ types.MsgServer = msgServer{}

func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if _, err := k.keeper.addressCodec.StringToBytes(req.Authority); err != nil {
if _, err := k.keeper.AccountKeeper.AddressCodec().StringToBytes(req.Authority); err != nil {
return nil, errorsmod.Wrap(err, "invalid authority address")
}

Expand Down
2 changes: 2 additions & 0 deletions x/psm/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package types
import (
"context"

addresscodec "cosmossdk.io/core/address"
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)

// AccountKeeper defines the expected interface for the Account module.
type AccountKeeper interface {
AddressCodec() addresscodec.Codec
GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation
GetModuleAddress(name string) sdk.AccAddress
// Methods imported from account should be defined here
Expand Down

0 comments on commit 89094ee

Please sign in to comment.