Consume from AccountsDataMeter (#21994)

This commit is contained in:
Brooks Prumo
2022-01-04 10:00:21 -06:00
committed by GitHub
parent 01a096adc8
commit 1460f00e0f
3 changed files with 192 additions and 2 deletions

View File

@@ -64,10 +64,21 @@ impl AccountsDataMeter {
let amount = amount.abs() as u64;
self.current = self.current.saturating_sub(amount);
}
Ok(())
}
}
#[cfg(test)]
impl AccountsDataMeter {
pub fn set_maximum(&mut self, maximum: u64) {
self.maximum = maximum;
}
pub fn set_current(&mut self, current: u64) {
self.current = current;
}
}
#[cfg(test)]
mod tests {
use super::*;