Skip to content

Commit

Permalink
initialize int64 vars
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed May 15, 2023
1 parent a74fbd6 commit b5923f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x/concentrated-liquidity/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b5923f0

Please sign in to comment.