Skip to content

Commit

Permalink
feat: fix supply denom validation in withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
soring323 committed Feb 12, 2024
1 parent b20464f commit 94b1c27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/gmm/types/message_withdraw.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"fmt"
"strings"

sdkerrors "cosmossdk.io/errors"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (msg *MsgWithdraw) ValidateBasic() error {
return sdkerrors.Wrap(ErrInvalidTokenAmount, "share amount cannot be zero")
}

if msg.PoolId != msg.Share.GetDenom() {
if fmt.Sprintf("side/gmm/%s", msg.PoolId) != msg.Share.GetDenom() {
return sdkerrors.Wrapf(ErrMismatchedShareDenom, "share denom and pool id do not match")
}
return nil
Expand Down

0 comments on commit 94b1c27

Please sign in to comment.