mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-12 03:28:13 -07:00
global: snapshot part 4
This commit is contained in:
@@ -7,7 +7,7 @@ use vecdb::{BinaryTransform, Database, Exit, ReadableVec, Rw, StorageMode, Versi
|
||||
use crate::{
|
||||
blocks, indexes,
|
||||
internal::{
|
||||
AmountPerBlockCumulativeWithSums, CachedWindowStarts, MaskSats, PercentRollingWindows,
|
||||
AmountPerBlockCumulativeRolling, CachedWindowStarts, MaskSats, PercentRollingWindows,
|
||||
RatioU64Bp16,
|
||||
},
|
||||
mining, prices,
|
||||
@@ -22,7 +22,7 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
#[traversable(flatten)]
|
||||
pub base: minor::Vecs<M>,
|
||||
|
||||
pub rewards: AmountPerBlockCumulativeWithSums<M>,
|
||||
pub rewards: AmountPerBlockCumulativeRolling<M>,
|
||||
#[traversable(rename = "dominance")]
|
||||
pub dominance_rolling: PercentRollingWindows<BasisPoints16, M>,
|
||||
}
|
||||
@@ -39,7 +39,7 @@ impl Vecs {
|
||||
|
||||
let base = minor::Vecs::forced_import(db, slug, version, indexes, cached_starts)?;
|
||||
|
||||
let rewards = AmountPerBlockCumulativeWithSums::forced_import(
|
||||
let rewards = AmountPerBlockCumulativeRolling::forced_import(
|
||||
db,
|
||||
&suffix("rewards"),
|
||||
version,
|
||||
|
||||
@@ -8,7 +8,7 @@ use vecdb::{
|
||||
use crate::{
|
||||
blocks, indexes,
|
||||
internal::{
|
||||
CachedWindowStarts, PerBlockCumulativeWithSums, PercentPerBlock, RatioU64Bp16,
|
||||
CachedWindowStarts, PerBlockCumulativeRolling, PercentPerBlock, RatioU64Bp16,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct Vecs<M: StorageMode = Rw> {
|
||||
#[traversable(skip)]
|
||||
slug: PoolSlug,
|
||||
|
||||
pub blocks_mined: PerBlockCumulativeWithSums<StoredU32, StoredU64, M>,
|
||||
pub blocks_mined: PerBlockCumulativeRolling<StoredU32, StoredU64, M>,
|
||||
pub dominance: PercentPerBlock<BasisPoints16, M>,
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ impl Vecs {
|
||||
) -> Result<Self> {
|
||||
let suffix = |s: &str| format!("{}_{s}", slug);
|
||||
|
||||
let blocks_mined = PerBlockCumulativeWithSums::forced_import(
|
||||
let blocks_mined = PerBlockCumulativeRolling::forced_import(
|
||||
db,
|
||||
&suffix("blocks_mined"),
|
||||
version + Version::ONE,
|
||||
|
||||
Reference in New Issue
Block a user