Skip to content

fix: f64 precision loss in keeper_balance — carry stroops in BalanceBelowMinimum - #613

Open
dev-nana27 wants to merge 3 commits into
SO4-Markets:mainfrom
dev-nana27:fix-f64-precision-loss-539
Open

fix: f64 precision loss in keeper_balance — carry stroops in BalanceBelowMinimum#613
dev-nana27 wants to merge 3 commits into
SO4-Markets:mainfrom
dev-nana27:fix-f64-precision-loss-539

Conversation

@dev-nana27

Copy link
Copy Markdown

Closes #539. Problem: check_keeper_balance converts integer stroops to f64, then BalanceBelowMinimum error only carries lossy f64. Admin handler reconstructs stroops via (balance_xlm * XLM_IN_STROOPS) as i64 — lossy round-trip. Fix: add balance_stroops to error, use directly.

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.

keeper_balance handler recomputes balance_stroops via a lossy f64 round-trip, returning an incorrect value when the account is below minimum

1 participant