mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: snapshot part 8
This commit is contained in:
@@ -6,7 +6,7 @@ use vecdb::{DeltaAvg, LazyDeltaVec, LazyVecFrom1, ReadableCloneableVec};
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
CachedWindowStarts, DerivedResolutions, AvgCentsToUsd, AvgSatsToBtc, LazyPerBlock,
|
||||
AvgCentsToUsd, AvgSatsToBtc, CachedWindowStarts, DerivedResolutions, LazyPerBlock,
|
||||
LazyRollingAvgFromHeight, Resolutions, Windows,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -29,7 +29,6 @@ where
|
||||
T: NumericValue + JsonSchema,
|
||||
C: NumericValue + JsonSchema,
|
||||
{
|
||||
#[traversable(hidden)]
|
||||
pub block: M::Stored<EagerVec<PcoVec<Height, T>>>,
|
||||
pub cumulative: PerBlock<C, M>,
|
||||
pub sum: LazyRollingSumsFromHeight<C>,
|
||||
|
||||
@@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, PcoVec, Rw, StorageMode};
|
||||
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{CachedWindowStarts, PerBlock, NumericValue, RollingComplete, WindowStarts},
|
||||
internal::{CachedWindowStarts, NumericValue, PerBlock, RollingComplete, WindowStarts},
|
||||
};
|
||||
|
||||
#[derive(Traversable)]
|
||||
@@ -18,7 +18,6 @@ pub struct PerBlockFull<T, M: StorageMode = Rw>
|
||||
where
|
||||
T: NumericValue + JsonSchema,
|
||||
{
|
||||
#[traversable(hidden)]
|
||||
pub block: M::Stored<EagerVec<PcoVec<Height, T>>>,
|
||||
pub cumulative: PerBlock<T, M>,
|
||||
#[traversable(flatten)]
|
||||
@@ -71,8 +70,7 @@ where
|
||||
self.cumulative
|
||||
.height
|
||||
.compute_cumulative(max_from, &self.block, exit)?;
|
||||
self.rolling
|
||||
.compute(max_from, windows, &self.block, exit)?;
|
||||
self.rolling.compute(max_from, windows, &self.block, exit)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ pub struct PerBlockRollingAverage<T, M: StorageMode = Rw>
|
||||
where
|
||||
T: NumericValue + JsonSchema,
|
||||
{
|
||||
#[traversable(hidden)]
|
||||
pub block: M::Stored<EagerVec<PcoVec<Height, T>>>,
|
||||
#[traversable(hidden)]
|
||||
pub cumulative: M::Stored<EagerVec<PcoVec<Height, T>>>,
|
||||
|
||||
Reference in New Issue
Block a user