Skip to content

Reorganize & clean exchange-rate logic#5447

Merged
swansontec merged 1 commit intodevelopfrom
william/fix-rate-cache
Feb 11, 2025
Merged

Reorganize & clean exchange-rate logic#5447
swansontec merged 1 commit intodevelopfrom
william/fix-rate-cache

Conversation

@swansontec
Copy link
Contributor

@swansontec swansontec commented Feb 8, 2025

Pull request #5423 contained a bunch of logic errors, so clean everything up in a way that makes it less confusing and less buggy.

  • Break up long lines.
  • Fix misleading comments.
  • Give variables better names.
  • Don't copy data needlessly.
  • Stomp old cache entries instead of mutating them.
  • Only add the account fiat pair once, instead of in two separate places.
  • Expire cache entries once a load-time, instead of doing this in three separate places.
  • Do not store reverse rates in the cache, but derive them at the very end.
  • Move getYesterdayDateRoundDownHour into this file, since it's only used here.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Pull request #5423 contained a bunch of logic errors, so clean everything up in a way that makes it less confusing and less buggy.

- Break up long lines.
- Fix misleading comments.
- Give variables better names.
- Don't copy data needlessly.
- Stomp old cache entries instead of mutating them.
- Only add the account fiat pair once, instead of in two separate places.
- Expire cache entries once a load-time, instead of doing this in three separate places.
- Do not store reverse rates in the cache, but derive them at the very end.
@swansontec swansontec force-pushed the william/fix-rate-cache branch from 24782fe to d47fe40 Compare February 11, 2025 23:34
@swansontec swansontec enabled auto-merge February 11, 2025 23:34
@swansontec swansontec merged commit ef8089b into develop Feb 11, 2025
2 checks passed
@swansontec swansontec deleted the william/fix-rate-cache branch February 11, 2025 23:44
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.

2 participants