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

View File

@@ -6,7 +6,7 @@ use brk_types::Version;
use super::Vecs;
use crate::{
indexes,
internal::{finalize_db, open_db, ComputedPerBlock, PercentPerBlock, RatioPerBlock},
internal::{PerBlock, PercentPerBlock, RatioPerBlock, db_utils::{finalize_db, open_db}},
};
const VERSION: Version = Version::new(1);
@@ -27,16 +27,16 @@ impl Vecs {
let thermocap_multiple =
RatioPerBlock::forced_import_raw(&db, "thermocap_multiple", v, indexes)?;
let coindays_destroyed_supply_adjusted =
ComputedPerBlock::forced_import(&db, "coindays_destroyed_supply_adjusted", v, indexes)?;
PerBlock::forced_import(&db, "coindays_destroyed_supply_adjusted", v, indexes)?;
let coinyears_destroyed_supply_adjusted =
ComputedPerBlock::forced_import(&db, "coinyears_destroyed_supply_adjusted", v, indexes)?;
PerBlock::forced_import(&db, "coinyears_destroyed_supply_adjusted", v, indexes)?;
let dormancy = super::vecs::DormancyVecs {
supply_adjusted: ComputedPerBlock::forced_import(&db, "dormancy_supply_adjusted", v, indexes)?,
flow: ComputedPerBlock::forced_import(&db, "dormancy_flow", v, indexes)?,
supply_adjusted: PerBlock::forced_import(&db, "dormancy_supply_adjusted", v, indexes)?,
flow: PerBlock::forced_import(&db, "dormancy_flow", v, indexes)?,
};
let stock_to_flow = ComputedPerBlock::forced_import(&db, "stock_to_flow", v, indexes)?;
let stock_to_flow = PerBlock::forced_import(&db, "stock_to_flow", v, indexes)?;
let seller_exhaustion_constant =
ComputedPerBlock::forced_import(&db, "seller_exhaustion_constant", v, indexes)?;
PerBlock::forced_import(&db, "seller_exhaustion_constant", v, indexes)?;
let this = Self {
db,

View File

@@ -2,12 +2,12 @@ use brk_traversable::Traversable;
use brk_types::{BasisPoints16, BasisPoints32, StoredF32};
use vecdb::{Database, Rw, StorageMode};
use crate::internal::{ComputedPerBlock, PercentPerBlock, RatioPerBlock};
use crate::internal::{PerBlock, PercentPerBlock, RatioPerBlock};
#[derive(Traversable)]
pub struct DormancyVecs<M: StorageMode = Rw> {
pub supply_adjusted: ComputedPerBlock<StoredF32, M>,
pub flow: ComputedPerBlock<StoredF32, M>,
pub supply_adjusted: PerBlock<StoredF32, M>,
pub flow: PerBlock<StoredF32, M>,
}
#[derive(Traversable)]
@@ -19,9 +19,9 @@ pub struct Vecs<M: StorageMode = Rw> {
pub gini: PercentPerBlock<BasisPoints16, M>,
pub rhodl_ratio: RatioPerBlock<BasisPoints32, M>,
pub thermocap_multiple: RatioPerBlock<BasisPoints32, M>,
pub coindays_destroyed_supply_adjusted: ComputedPerBlock<StoredF32, M>,
pub coinyears_destroyed_supply_adjusted: ComputedPerBlock<StoredF32, M>,
pub coindays_destroyed_supply_adjusted: PerBlock<StoredF32, M>,
pub coinyears_destroyed_supply_adjusted: PerBlock<StoredF32, M>,
pub dormancy: DormancyVecs<M>,
pub stock_to_flow: ComputedPerBlock<StoredF32, M>,
pub seller_exhaustion_constant: ComputedPerBlock<StoredF32, M>,
pub stock_to_flow: PerBlock<StoredF32, M>,
pub seller_exhaustion_constant: PerBlock<StoredF32, M>,
}