spl_token/
native_mint.rs

1//! The Mint that represents the native token
2
3/// There are 10^9 lamports in one MLN
4pub const DECIMALS: u8 = 9;
5
6// The Mint for native MLN Token accounts
7miraland_program::declare_id!("MLN1111111111111111111111111111111111111111");
8
9#[cfg(test)]
10mod tests {
11    use {super::*, miraland_program::native_token::*};
12
13    #[test]
14    fn test_decimals() {
15        assert!(
16            (lamports_to_mln(42) - crate::amount_to_ui_amount(42, DECIMALS)).abs() < f64::EPSILON
17        );
18        assert_eq!(
19            mln_to_lamports(42.),
20            crate::ui_amount_to_amount(42., DECIMALS)
21        );
22    }
23}