junobuild_shared/ledger/
impls.rs

1use crate::ledger::types::cycles::CyclesTokens;
2
3impl CyclesTokens {
4    pub const fn from_e12s(e12s: u64) -> Self {
5        Self { e12s }
6    }
7
8    pub const fn e12s(&self) -> u64 {
9        self.e12s
10    }
11}
12
13impl std::ops::Sub for CyclesTokens {
14    type Output = Self;
15
16    fn sub(self, other: Self) -> Self {
17        Self::from_e12s(self.e12s() - other.e12s())
18    }
19}