From d1c7b6f57ac87c15d4a887d92ea70507fe314c1b Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 19 May 2023 16:55:59 -0500 Subject: [PATCH] rename lockNoSend back to lock --- x/lockup/keeper/export_test.go | 4 ++-- x/lockup/keeper/lock.go | 8 ++++---- x/lockup/keeper/lock_test.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x/lockup/keeper/export_test.go b/x/lockup/keeper/export_test.go index 433cf4273b1..527b5fa29e5 100644 --- a/x/lockup/keeper/export_test.go +++ b/x/lockup/keeper/export_test.go @@ -22,8 +22,8 @@ func (k Keeper) GetCoinsFromLocks(locks []types.PeriodLock) sdk.Coins { return k.getCoinsFromLocks(locks) } -func (k Keeper) LockNoSend(ctx sdk.Context, lock types.PeriodLock, tokensToLock sdk.Coins) error { - return k.lockNoSend(ctx, lock, tokensToLock) +func (k Keeper) Lock(ctx sdk.Context, lock types.PeriodLock, tokensToLock sdk.Coins) error { + return k.lock(ctx, lock, tokensToLock) } func (k Keeper) UnlockMaturedLockInternalLogic(ctx sdk.Context, lock types.PeriodLock) error { diff --git a/x/lockup/keeper/lock.go b/x/lockup/keeper/lock.go index 410957f9770..16ec390dcba 100644 --- a/x/lockup/keeper/lock.go +++ b/x/lockup/keeper/lock.go @@ -100,7 +100,7 @@ func (k Keeper) AddTokensToLockByID(ctx sdk.Context, lockID uint64, owner sdk.Ac return nil, err } - err = k.lockNoSend(ctx, *lock, sdk.NewCoins(tokensToAdd)) + err = k.lock(ctx, *lock, sdk.NewCoins(tokensToAdd)) if err != nil { return nil, err } @@ -147,7 +147,7 @@ func (k Keeper) CreateLockNoSend(ctx sdk.Context, owner sdk.AccAddress, coins sd lock := types.NewPeriodLock(ID, owner, duration, time.Time{}, coins) // lock the coins without sending them to the lockup module account - err := k.lockNoSend(ctx, lock, lock.Coins) + err := k.lock(ctx, lock, lock.Coins) if err != nil { return lock, err } @@ -162,13 +162,13 @@ func (k Keeper) CreateLockNoSend(ctx sdk.Context, owner sdk.AccAddress, coins sd return lock, nil } -// lockNoSend is an internal utility to lock coins and set corresponding states. +// lock is an internal utility to lock coins and set corresponding states. // This is only called by either of the two possible entry points to lock tokens. // 1. CreateLock // 2. AddTokensToLockByID // WARNING: this method does not send the underlying coins to the lockup module account. // This must be done by the caller. -func (k Keeper) lockNoSend(ctx sdk.Context, lock types.PeriodLock, tokensToLock sdk.Coins) error { +func (k Keeper) lock(ctx sdk.Context, lock types.PeriodLock, tokensToLock sdk.Coins) error { owner, err := sdk.AccAddressFromBech32(lock.Owner) if err != nil { return err diff --git a/x/lockup/keeper/lock_test.go b/x/lockup/keeper/lock_test.go index 54ff81afea6..a9a494de881 100644 --- a/x/lockup/keeper/lock_test.go +++ b/x/lockup/keeper/lock_test.go @@ -773,7 +773,7 @@ func (suite *KeeperTestSuite) TestLockNoSend() { } // test locking without balance (should work since we don't send the underlying balance) - err := suite.App.LockupKeeper.LockNoSend(suite.Ctx, lock, coins) + err := suite.App.LockupKeeper.Lock(suite.Ctx, lock, coins) suite.Require().NoError(err) // check accumulation store @@ -785,7 +785,7 @@ func (suite *KeeperTestSuite) TestLockNoSend() { suite.Require().Equal(accum.String(), "10") suite.FundAcc(addr1, coins) - err = suite.App.LockupKeeper.LockNoSend(suite.Ctx, lock, coins) + err = suite.App.LockupKeeper.Lock(suite.Ctx, lock, coins) suite.Require().NoError(err) // check accumulation store