From 3ff88f71c752f0c97be79dcb7593d83c6f241a2c Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Mon, 10 Apr 2023 16:31:36 -0700 Subject: [PATCH] rename function to positionHasUnderlyingLockInState --- x/concentrated-liquidity/export_test.go | 4 ++-- x/concentrated-liquidity/lp.go | 2 +- x/concentrated-liquidity/position.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/concentrated-liquidity/export_test.go b/x/concentrated-liquidity/export_test.go index c785e0be503..07b427a775a 100644 --- a/x/concentrated-liquidity/export_test.go +++ b/x/concentrated-liquidity/export_test.go @@ -126,8 +126,8 @@ func (k Keeper) IsLockMature(ctx sdk.Context, underlyingLockId uint64) (bool, er return k.isLockMature(ctx, underlyingLockId) } -func (k Keeper) DoesPositionHaveUnderlyingLockInState(ctx sdk.Context, positionId uint64) bool { - return k.doesPositionHaveUnderlyingLockInState(ctx, positionId) +func (k Keeper) PositionHasUnderlyingLockInState(ctx sdk.Context, positionId uint64) bool { + return k.positionHasUnderlyingLockInState(ctx, positionId) } // fees methods diff --git a/x/concentrated-liquidity/lp.go b/x/concentrated-liquidity/lp.go index c9cf9d5f08c..cd0600b944a 100644 --- a/x/concentrated-liquidity/lp.go +++ b/x/concentrated-liquidity/lp.go @@ -139,7 +139,7 @@ func (k Keeper) withdrawPosition(ctx sdk.Context, owner sdk.AccAddress, position // If underlying lock exists in state, validate unlocked conditions are met before withdrawing liquidity. // If unlocked conditions are met, remove the link between the position and the underlying lock. - if k.doesPositionHaveUnderlyingLockInState(ctx, position.PositionId) { + if k.positionHasUnderlyingLockInState(ctx, position.PositionId) { lockId, err := k.GetPositionIdToLock(ctx, positionId) if err != nil { return sdk.Int{}, sdk.Int{}, err diff --git a/x/concentrated-liquidity/position.go b/x/concentrated-liquidity/position.go index d2c877b095f..008b1e4d549 100644 --- a/x/concentrated-liquidity/position.go +++ b/x/concentrated-liquidity/position.go @@ -180,7 +180,7 @@ func (k Keeper) SetPosition(ctx sdk.Context, // Set the position ID to underlying lock ID mapping if underlyingLockId is provided. key = types.KeyPositionIdForLock(positionId) - positionHasUnderlyingLock := k.doesPositionHaveUnderlyingLockInState(ctx, positionId) + positionHasUnderlyingLock := k.positionHasUnderlyingLockInState(ctx, positionId) if !positionHasUnderlyingLock && underlyingLockId != 0 { // We did not find an underlying lock ID, but one was provided. Set it. store.Set(key, sdk.Uint64ToBigEndian(underlyingLockId)) @@ -399,7 +399,7 @@ func (k Keeper) validatePositionsAndGetTotalLiquidity(ctx sdk.Context, owner sdk } // Check that all the positions have no underlying lock that has not yet matured. - positionHasUnderlyingLock := k.doesPositionHaveUnderlyingLockInState(ctx, positionId) + positionHasUnderlyingLock := k.positionHasUnderlyingLockInState(ctx, positionId) if positionHasUnderlyingLock { underlyingLockId, err := k.GetPositionIdToLock(ctx, positionId) if err != nil { @@ -476,8 +476,8 @@ func (k Keeper) RemovePositionIdToLock(ctx sdk.Context, positionId uint64) { store.Delete(key) } -// doesPositionHaveUnderlyingLockInState checks if a given positionId has a corresponding lock in state. -func (k Keeper) doesPositionHaveUnderlyingLockInState(ctx sdk.Context, positionId uint64) bool { +// positionHasUnderlyingLockInState checks if a given positionId has a corresponding lock in state. +func (k Keeper) positionHasUnderlyingLockInState(ctx sdk.Context, positionId uint64) bool { // Get the lock ID for the position. _, err := k.GetPositionIdToLock(ctx, positionId) return !errors.Is(err, types.PositionIdToLockNotFoundError{PositionId: positionId})