Skip to content

Commit

Permalink
chore: state breaking barberry fix (#478) (#479)
Browse files Browse the repository at this point in the history
(cherry picked from commit 77b364b)

Co-authored-by: Roman <[email protected]>
  • Loading branch information
mergify[bot] and p0mvn authored Jul 3, 2023
1 parent fe548cf commit ed4eb88
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 ed4eb88

Please sign in to comment.