curveresearch / curvesim

Simulates Curve Finance pools
MIT License
156 stars 32 forks source link

Fix calc diff #280

Closed chanhosuh closed 1 year ago

chanhosuh commented 1 year ago

Description

Resolved discrepancy in get_y between python and vyper that was causing CI to fail on a unit test: https://github.com/curveresearch/curvesim/actions/runs/6722748992/job/18271450059

Bug was due to not handling all cases of python's signed integer division not rounding toward zero. Other possible sign issues were also patched.

Commit history shows a clean debug trail in case this is needed in the future.

Hygiene checklist

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

github-actions[bot] commented 1 year ago

Coverage report

The coverage rate went from 76.03% to 77.98% :arrow_up: The branch rate is 64%.

66.66% of new lines are covered.

Diff Coverage details (click to unfold) ### curvesim/pool/cryptoswap/calcs/tricrypto_ng.py `66.66%` of new lines are covered (`83.6%` of the complete file). Missing lines: `136`, `152`, `163`, `167`