mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: snapshot
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user