From 77b364b80f7c2b7f35f1ec3d9d6e346b2bb64c01 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 2 Jul 2023 19:46:00 -0400 Subject: [PATCH] chore: state breaking barberry fix (#478) --- x/auth/vesting/msg_server.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go index ff9b6b4fcd33..6e82d8c17a4d 100644 --- a/x/auth/vesting/msg_server.go +++ b/x/auth/vesting/msg_server.go @@ -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