From fe8e97147380d09491310ee93c2253a1b5a3ee1d Mon Sep 17 00:00:00 2001 From: javiersuweijie Date: Tue, 11 Jun 2024 22:18:30 +0800 Subject: [PATCH] use AccAddressFromBech32 --- x/tokenfactory/keeper/msg_server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 1b4118f4..11dcdf09 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -113,7 +113,11 @@ func (server msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types. msg.BurnFromAddress = msg.Sender } - accountI := server.Keeper.accountKeeper.GetAccount(ctx, sdk.MustAccAddressFromBech32(msg.BurnFromAddress)) + acc, err := sdk.AccAddressFromBech32(msg.BurnFromAddress) + if err != nil { + return nil, err + } + accountI := server.Keeper.accountKeeper.GetAccount(ctx, acc) _, ok := accountI.(authtypes.ModuleAccountI) if ok { return nil, types.ErrBurnFromModuleAccount