Skip to content

Commit

Permalink
fix: patch barberry (cosmos#16466)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored and yihuang committed Jun 8, 2023
1 parent 0a93ffb commit c8ad6f2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/auth/vesting/types/msgs.go
Expand Up @@ -182,6 +182,14 @@ func (msg MsgCreatePeriodicVestingAccount) ValidateBasic() error {
}

for i, period := range msg.VestingPeriods {
if !period.Amount.IsValid() {
return sdkerrors.ErrInvalidCoins.Wrap(period.Amount.String())
}

if !period.Amount.IsAllPositive() {
return sdkerrors.ErrInvalidCoins.Wrap(period.Amount.String())
}

if period.Length < 1 {
return fmt.Errorf("invalid period length of %d in period %d, length must be greater than 0", period.Length, i)
}
Expand Down

0 comments on commit c8ad6f2

Please sign in to comment.