From 94f1bfdb754648685dc92bfdb39ceae576b5a2fa Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 8 Jun 2023 18:05:37 +0200 Subject: [PATCH] fix: patch barberry (#16466) --- x/auth/vesting/types/msgs.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/auth/vesting/types/msgs.go b/x/auth/vesting/types/msgs.go index fbce860cede4..f2194af5690b 100644 --- a/x/auth/vesting/types/msgs.go +++ b/x/auth/vesting/types/msgs.go @@ -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) }