Skip to content

Commit

Permalink
chore: state breaking barberry fix (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn authored Jul 2, 2023
1 parent 4c20864 commit 77b364b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions x/auth/vesting/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ func (s msgServer) CreateClawbackVestingAccount(goCtx context.Context, msg *type
lockupCoins = lockupCoins.Add(period.Amount...)
}

if ctx.IsCheckTx() {
if err := lockupCoins.Validate(); err != nil {
return nil, sdkerrors.Wrapf(
sdkerrors.ErrInvalidCoins, "lockup coins %s are invalid: %v", lockupCoins, err)
}
if err := vestingCoins.Validate(); err != nil {
return nil, sdkerrors.Wrapf(
sdkerrors.ErrInvalidCoins, "vesting coins %s are invalid: %v", vestingCoins, err)
}
if err := lockupCoins.Validate(); err != nil {
return nil, sdkerrors.Wrapf(
sdkerrors.ErrInvalidCoins, "lockup coins %s are invalid: %v", lockupCoins, err)
}
if err := vestingCoins.Validate(); err != nil {
return nil, sdkerrors.Wrapf(
sdkerrors.ErrInvalidCoins, "vesting coins %s are invalid: %v", vestingCoins, err)
}

// if lockup absent, default to an instant unlock schedule
Expand Down

0 comments on commit 77b364b

Please sign in to comment.