fix: JMD currency precision — backend fixes (#282)#363
Conversation
… static rate Backend fixes for lnflash#282: - Math.round() instead of Math.floor() for exchange rates - Correct offset (12 BTC, 6 USD) instead of 0n - displayCurrency parameter instead of hardcoded "USD" - JMD conversion via ExchangeRates.jmd.sell static rate - Price service uses static JMD rate instead of BTC triangulation 15 new tests covering all fix areas. 48/48 tests pass.
|
Hi @islandbitcoin — I noticed PR #363 was closed without comment. I'd appreciate any feedback on what was wrong with the approach or if there's a different direction you'd prefer for the JMD currency precision fixes (#282). The implementation addressed the specific issues from the code review on PR #309 (NaN type errors, missing tests, Math.floor → Math.round), but happy to rework if there's a better way to handle this. Thanks for your time. |
|
We closed the bounty program for now. If you would like to contribute, please first join our Discord server. |
|
Thanks @islandbitcoin — appreciate the direct answer. Understood on the bounty program pause. The proto PRs (#364, #365 — float→double in price.proto) are separate from the bounty; they just fix a precision blocker regardless of bounty status. Happy to keep those open for review if useful, or close them if not. Will join the Discord. Thanks again for the transparency. |
Fixes the backend portion of #282. Addresses issues from earlier PR reviews (#304, #309).
Changes:
15 new unit tests. 48/48 passing, zero regressions.
/claim #282