Skip to content

Commit

Permalink
use AccAddressFromBech32
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Jun 11, 2024
1 parent 23b7f26 commit fe8e971
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/tokenfactory/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe8e971

Please sign in to comment.