Remove lingering references to base-2 SOLs (#6629)

automerge
This commit is contained in:
Justin Starry
2019-10-30 17:59:44 -04:00
committed by Grimes
parent 6d403f2d85
commit d2d78a073f
4 changed files with 8 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
/// There are 2^34 lamports in one sol
/// There are 10^9 lamports in one SOL
pub const SOL_LAMPORTS: u64 = 1_000_000_000;
/// Approximately convert fractional native tokens (lamports) into native tokens (sol)
/// Approximately convert fractional native tokens (lamports) into native tokens (SOL)
pub fn lamports_to_sol(lamports: u64) -> f64 {
lamports as f64 / SOL_LAMPORTS as f64
}
/// Approximately convert native tokens (sol) into fractional native tokens (lamports)
/// Approximately convert native tokens (SOL) into fractional native tokens (lamports)
pub fn sol_to_lamports(sol: f64) -> u64 {
(sol * SOL_LAMPORTS as f64) as u64
}