global: snapshot

This commit is contained in:
nym21
2026-03-07 00:25:20 +01:00
parent 9507eb3de5
commit 011e49e1cc
28 changed files with 256 additions and 395 deletions
@@ -16,8 +16,8 @@ pub struct ActivityBase<M: StorageMode = Rw> {
impl ActivityBase {
pub(crate) fn forced_import(cfg: &ImportConfig) -> Result<Self> {
Ok(Self {
sent: cfg.import_value_cumulative("sent", Version::ZERO)?,
sent_ema: cfg.import_emas_2w("sent", Version::ZERO)?,
sent: cfg.import("sent", Version::ZERO)?,
sent_ema: cfg.import("sent", Version::ZERO)?,
})
}
@@ -26,8 +26,8 @@ impl ActivityFull {
Ok(Self {
base: ActivityBase::forced_import(cfg)?,
coinblocks_destroyed: cfg
.import_cumulative_sum("coinblocks_destroyed", Version::ONE)?,
coindays_destroyed: cfg.import_cumulative_sum("coindays_destroyed", Version::ONE)?,
.import("coinblocks_destroyed", Version::ONE)?,
coindays_destroyed: cfg.import("coindays_destroyed", Version::ONE)?,
})
}
@@ -1,5 +1,5 @@
mod base;
mod full;
pub use base::*;
pub use full::*;
pub use base::ActivityBase;
pub use full::ActivityFull;