Skip to content

Commit

Permalink
Huckleberry patch (#469) (#470)
Browse files Browse the repository at this point in the history
(cherry picked from commit 40097d1)

Co-authored-by: Dev Ojha <[email protected]>
  • Loading branch information
mergify[bot] and ValarDragon authored Jun 26, 2023
1 parent 172d9b8 commit cbdc801
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions x/auth/vesting/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ 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 lockup absent, default to an instant unlock schedule
lockupPeriods := msg.LockupPeriods
vestingPeriods := msg.VestingPeriods
Expand Down

0 comments on commit cbdc801

Please sign in to comment.