global: snapshot

This commit is contained in:
nym21
2026-03-13 16:27:10 +01:00
parent b2a1251774
commit 3709ceff8e
168 changed files with 2007 additions and 2008 deletions
@@ -25,7 +25,7 @@ impl Vecs {
vec.compute_multiply(
starting_indexes.height,
&prices.spot.usd.height,
&coinblocks_destroyed.raw.height,
&coinblocks_destroyed.base.height,
exit,
)?;
Ok(())
@@ -36,7 +36,7 @@ impl Vecs {
vec.compute_multiply(
starting_indexes.height,
&prices.spot.usd.height,
&activity.coinblocks_created.raw.height,
&activity.coinblocks_created.base.height,
exit,
)?;
Ok(())
@@ -47,7 +47,7 @@ impl Vecs {
vec.compute_multiply(
starting_indexes.height,
&prices.spot.usd.height,
&activity.coinblocks_stored.raw.height,
&activity.coinblocks_stored.base.height,
exit,
)?;
Ok(())
@@ -61,7 +61,7 @@ impl Vecs {
vec.compute_transform3(
starting_indexes.height,
&prices.spot.usd.height,
&coindays_destroyed.raw.height,
&coindays_destroyed.base.height,
circulating_supply,
|(i, price, cdd, supply, _): (_, Dollars, StoredF64, Bitcoin, _)| {
let supply_f64 = f64::from(supply);
@@ -5,7 +5,7 @@ use vecdb::Database;
use super::Vecs;
use crate::{
indexes,
internal::{CachedWindowStarts, ComputedPerBlockCumulativeWithSums},
internal::{CachedWindowStarts, PerBlockCumulativeWithSums},
};
impl Vecs {
@@ -16,28 +16,28 @@ impl Vecs {
cached_starts: &CachedWindowStarts,
) -> Result<Self> {
Ok(Self {
destroyed: ComputedPerBlockCumulativeWithSums::forced_import(
destroyed: PerBlockCumulativeWithSums::forced_import(
db,
"cointime_value_destroyed",
version,
indexes,
cached_starts,
)?,
created: ComputedPerBlockCumulativeWithSums::forced_import(
created: PerBlockCumulativeWithSums::forced_import(
db,
"cointime_value_created",
version,
indexes,
cached_starts,
)?,
stored: ComputedPerBlockCumulativeWithSums::forced_import(
stored: PerBlockCumulativeWithSums::forced_import(
db,
"cointime_value_stored",
version,
indexes,
cached_starts,
)?,
vocdd: ComputedPerBlockCumulativeWithSums::forced_import(
vocdd: PerBlockCumulativeWithSums::forced_import(
db,
"vocdd",
version + Version::ONE,
@@ -2,12 +2,12 @@ use brk_traversable::Traversable;
use brk_types::StoredF64;
use vecdb::{Rw, StorageMode};
use crate::internal::ComputedPerBlockCumulativeWithSums;
use crate::internal::PerBlockCumulativeWithSums;
#[derive(Traversable)]
pub struct Vecs<M: StorageMode = Rw> {
pub destroyed: ComputedPerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub created: ComputedPerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub stored: ComputedPerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub vocdd: ComputedPerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub destroyed: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub created: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub stored: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
pub vocdd: PerBlockCumulativeWithSums<StoredF64, StoredF64, M>,
}