From b5923f01c5039f7e755790196207846a4f306edc Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Mon, 15 May 2023 14:04:51 -0500 Subject: [PATCH] initialize int64 vars --- x/concentrated-liquidity/tick.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x/concentrated-liquidity/tick.go b/x/concentrated-liquidity/tick.go index ccbce906047..c84ece6d0d6 100644 --- a/x/concentrated-liquidity/tick.go +++ b/x/concentrated-liquidity/tick.go @@ -209,14 +209,17 @@ func roundTickToCanonicalPriceTick(lowerTick, upperTick int64, priceTickLower, p return 0, 0, err } + newLowerTickInt64 := newLowerTick.Int64() + newUpperTickInt64 := newUpperTick.Int64() + // If the lower or upper tick has changed, we need to re-validate the tick range. - if lowerTick != newLowerTick.Int64() || upperTick != newUpperTick.Int64() { - err := validateTickRangeIsValid(tickSpacing, newLowerTick.Int64(), newUpperTick.Int64()) + if lowerTick != newLowerTickInt64 || upperTick != newUpperTickInt64 { + err := validateTickRangeIsValid(tickSpacing, newLowerTickInt64, newUpperTickInt64) if err != nil { return 0, 0, err } } - return newLowerTick.Int64(), newUpperTick.Int64(), nil + return newLowerTickInt64, newUpperTickInt64, nil } // GetTickLiquidityForFullRange returns an array of liquidity depth for all ticks existing from min tick ~ max tick.