feat(proto): upgrade price_history.proto float to double (#283)#365
Closed
onchito-walks wants to merge 3 commits into
Closed
feat(proto): upgrade price_history.proto float to double (#283)#365onchito-walks wants to merge 3 commits into
onchito-walks wants to merge 3 commits into
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.
…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.
Author
|
Closing — messy branch. Clean proto fix at #366. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change as PR #364, for the price history service.
Change:
Tick.price→float→doubleinprice_history.protoWhy: 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.