Skip to content

feat(proto): upgrade price_history.proto float to double (#283)#365

Closed
onchito-walks wants to merge 3 commits into
lnflash:mainfrom
onchito-walks:feat/price-history-proto-float-to-double
Closed

feat(proto): upgrade price_history.proto float to double (#283)#365
onchito-walks wants to merge 3 commits into
lnflash:mainfrom
onchito-walks:feat/price-history-proto-float-to-double

Conversation

@onchito-walks
Copy link
Copy Markdown

Same change as PR #364, for the price history service.

Change: Tick.pricefloatdouble in price_history.proto

Why: Consistent with the price.proto upgrade. The price history service also sends exchange rate data that needs 64-bit precision for JMD and other fiat currencies.

Impact: Protobuf handles float→double conversion transparently. No breaking changes.

1 file changed, 1 insertion, 1 deletion.

… 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.
…recision (lnflash#283)

Changes PriceResponse.price from float (32-bit, ~7 sig figs) to double
(64-bit, ~15 sig figs). Float32 silently truncates JMD and other fiat
exchange rates that need more than 7 significant digits of precision.

This is a wire-compatible change: protobuf handles float→double
conversion automatically on the client side, and the price server
can be updated independently.

Phase 1 blocker for multi-currency price-server (ENG-315, lnflash#283).
Consistent with price.proto change (PR lnflash#364). Tick.price in the
price history service also needs 64-bit precision for multi-currency
support — float32 truncates exchange rates for JMD and other fiat
currencies that require >7 significant digits.

Wire-compatible: protobuf handles float->double transparently.
@onchito-walks
Copy link
Copy Markdown
Author

Closing — messy branch. Clean proto fix at #366.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant