Skip to content

fix: use exact string amount for Solana balance instead of float round trip#103

Open
samarthpatel24 wants to merge 1 commit into
stripe:mainfrom
samarthpatel24:fix/solana-balance-float-precision
Open

fix: use exact string amount for Solana balance instead of float round trip#103
samarthpatel24 wants to merge 1 commit into
stripe:mainfrom
samarthpatel24:fix/solana-balance-float-precision

Conversation

@samarthpatel24

@samarthpatel24 samarthpatel24 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • get_balance was using ui_amount (f64) from the Solana RPC and multiplying back to atomic units, causing floating-point precision loss (e.g. 0.1 * 1_000_00099999 instead of 100000)
  • Now uses token_balance.amount (the exact atomic units string from the RPC) directly, matching the pattern already used by the EVM and Tempo providers

Test plan

  • cargo check passes
  • Existing Solana tests pass
  • No ripple effect — NetworkBalance.balance_atomic is already a String field

@cla-assistant

cla-assistant Bot commented Jun 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented Jun 4, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@samarthpatel24 samarthpatel24 changed the title fix: use exact string amount for Solana balance instead of float roun… fix: use exact string amount for Solana balance instead of float round trip Jun 4, 2026
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