xand_ledger/model/total_issuance.rs
1/// Trait for tracking the current total number of claims
2pub trait TotalIssuanceRepository {
3 /// Increase the total cash confirmed claims by the provided amount
4 fn add_to_total_cash_confirmations(&self, amount: u64) -> u64;
5 /// Get the total number of claims that have *ever* been cash confirmed on the network. Note that
6 /// this is **not** the total number of claims *currently present* on the network.
7 fn get_total_cash_confirmations(&self) -> u64;
8
9 /// Increase the total redeemed claims amount by the provided amount
10 fn add_to_total_redeemed(&self, amount: u64) -> u64;
11
12 /// Decrease the total redeemed claims amount by the provided amount
13 fn subtract_from_total_redeemed(&self, amount: u64) -> u64;
14
15 /// Get the total number of claims that have *ever* been redeemed on the network.
16 fn get_total_redeemed(&self) -> u64;
17
18 fn get_total_claims(&self) -> u64 {
19 self.get_total_cash_confirmations() - self.get_total_redeemed()
20 }
21}