Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lee ByeongJun <[email protected]>
  • Loading branch information
onlyhyde and notJoon authored Dec 16, 2024
1 parent d2bb70c commit d71fbb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _deploy/r/gnoswap/common/tick_math.gno
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TickMathGetSqrtRatioAtTick(tick int32) *u256.Uint { // uint160 sqrtPriceX96
if absTick > maxTick {
panic(addDetailToError(
errOutOfRange,
ufmt.Sprintf("tick_math.gno__TickMathGetSqrtRatioAtTick() || tick is out of range (larger than 887272), tick: %d", tick),
ufmt.Sprintf("tick is out of range (larger than 887272), tick: %d", tick),
))
}

Expand Down
4 changes: 2 additions & 2 deletions pool/liquidity_math.gno
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func liquidityMathAddDelta(x *u256.Uint, y *i256.Int) *u256.Uint {
if y.Lt(i256.Zero()) {
absDelta := y.Abs()
z = new(u256.Uint).Sub(x, absDelta)
if z.Gte(x) { // z must be < x
if z.Gte(x) {
panic(addDetailToError(
errLiquidityCalculation,
ufmt.Sprintf("LS(z must be < x) (x: %s, y: %s, z:%s)", x.ToString(), y.ToString(), z.ToString()),
))
}
} else {
z = new(u256.Uint).Add(x, y.Abs())
if z.Lt(x) { // z must be >= x
if z.Lt(x) {
panic(addDetailToError(
errLiquidityCalculation,
ufmt.Sprintf("LA(z must be >= x) (x: %s, y: %s, z:%s)", x.ToString(), y.ToString(), z.ToString()),
Expand Down

0 comments on commit d71fbb4

Please sign in to comment.