From dba0383209de198041df5dd7699b19951b927bfc Mon Sep 17 00:00:00 2001 From: mconcat Date: Tue, 3 May 2022 00:24:49 +0900 Subject: [PATCH] fix test --- x/lockup/keeper/lock.go | 2 +- x/lockup/keeper/lock_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/lockup/keeper/lock.go b/x/lockup/keeper/lock.go index 717d8dfdba5..0d031e28427 100644 --- a/x/lockup/keeper/lock.go +++ b/x/lockup/keeper/lock.go @@ -551,7 +551,7 @@ func (k Keeper) ExtendLockup(ctx sdk.Context, lock types.PeriodLock, newDuration oldLock := lock if newDuration != 0 { - if newDuration < lock.Duration { + if newDuration <= lock.Duration { return fmt.Errorf("new duration should be greater than the original") } diff --git a/x/lockup/keeper/lock_test.go b/x/lockup/keeper/lock_test.go index 86c79c112f5..621571317e5 100644 --- a/x/lockup/keeper/lock_test.go +++ b/x/lockup/keeper/lock_test.go @@ -671,7 +671,7 @@ func (suite *KeeperTestSuite) TestEditLockup() { // extending lock with same duration should fail err = suite.App.LockupKeeper.ExtendLockup(suite.Ctx, *lock, time.Second) suite.Require().Error(err) - + // duration increase should success err = suite.App.LockupKeeper.ExtendLockup(suite.Ctx, *lock, time.Second*2) suite.Require().NoError(err) @@ -679,9 +679,9 @@ func (suite *KeeperTestSuite) TestEditLockup() { // check queries lock, _ = suite.App.LockupKeeper.GetLockByID(suite.Ctx, lock.ID) suite.Require().Equal(lock.Duration, time.Second*2) - suite.Require().Equal(1, lock.ID) + suite.Require().Equal(uint64(1), lock.ID) suite.Require().Equal(coins, lock.Coins) - + locks = suite.App.LockupKeeper.GetLocksLongerThanDurationDenom(suite.Ctx, "stake", time.Second) suite.Require().Equal(len(locks), 1)