lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

deficit.rs (1546B)


      1 use radroots_domain::{AgreementLineId, OperationId, PoolId, stock::ObligationBacking};
      2 
      3 /// A retained correction's original-allocation deficit at that transaction.
      4 /// This is historical effect metadata, not a current backing or authority proof.
      5 #[derive(Clone, Copy, Eq, PartialEq)]
      6 pub struct StockDeficit {
      7     acceptance: OperationId,
      8     installation: OperationId,
      9     line: AgreementLineId,
     10     pool: PoolId,
     11     backing: ObligationBacking,
     12 }
     13 impl StockDeficit {
     14     /// Reconstructs metadata only. The store must independently authenticate
     15     /// the original allocation, correction, transaction and current access.
     16     pub const fn from_host_metadata(
     17         acceptance: OperationId,
     18         installation: OperationId,
     19         line: AgreementLineId,
     20         pool: PoolId,
     21         backing: ObligationBacking,
     22     ) -> Self {
     23         Self {
     24             acceptance,
     25             installation,
     26             line,
     27             pool,
     28             backing,
     29         }
     30     }
     31     pub const fn acceptance(self) -> OperationId {
     32         self.acceptance
     33     }
     34     pub const fn installation(self) -> OperationId {
     35         self.installation
     36     }
     37     pub const fn line(self) -> AgreementLineId {
     38         self.line
     39     }
     40     pub const fn pool(self) -> PoolId {
     41         self.pool
     42     }
     43     pub const fn backing(self) -> ObligationBacking {
     44         self.backing
     45     }
     46 }
     47 impl core::fmt::Debug for StockDeficit {
     48     fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
     49         f.write_str("StockDeficit(<private effect metadata>)")
     50     }
     51 }