From 89094ee945ed2f902eb0717e740032a323c5ba4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=C3=B4ng=20Li=E1=BB=81u?= Date: Tue, 14 Jan 2025 16:42:38 +0700 Subject: [PATCH] update with address.Codec --- x/psm/keeper/msg_server.go | 2 +- x/psm/types/expected_keepers.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x/psm/keeper/msg_server.go b/x/psm/keeper/msg_server.go index 04f97ee..e25f468 100644 --- a/x/psm/keeper/msg_server.go +++ b/x/psm/keeper/msg_server.go @@ -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") } diff --git a/x/psm/types/expected_keepers.go b/x/psm/types/expected_keepers.go index 37a5135..6ad9492 100644 --- a/x/psm/types/expected_keepers.go +++ b/x/psm/types/expected_keepers.go @@ -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