Michael Vines 5 年之前
父节点
当前提交
b34206d43e
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      program/src/native_mint.rs

+ 2 - 3
program/src/native_mint.rs

@@ -13,9 +13,8 @@ mod tests {
 
     #[test]
     fn test_decimals() {
-        assert_eq!(
-            lamports_to_sol(42),
-            crate::amount_to_ui_amount(42, DECIMALS)
+        assert!(
+            lamports_to_sol(42) - crate::amount_to_ui_amount(42, DECIMALS).abs() < f64::EPSILON
         );
         assert_eq!(
             sol_to_lamports(42.),