mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-27 10:48:11 -07:00
computer: snapshot
This commit is contained in:
@@ -13,7 +13,7 @@ impl Vecs {
|
||||
distribution: &distribution::Vecs,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let window_starts = blocks.count.window_starts();
|
||||
let window_starts = blocks.lookback.window_starts();
|
||||
|
||||
let all_metrics = &distribution.utxo_cohorts.all.metrics;
|
||||
let circulating_supply = &all_metrics.supply.total.sats.height;
|
||||
|
||||
@@ -16,7 +16,7 @@ impl Vecs {
|
||||
) -> Result<()> {
|
||||
self.vocdd_median_1y.compute_rolling_median_from_starts(
|
||||
starting_indexes.height,
|
||||
&blocks.count.height_1y_ago,
|
||||
&blocks.lookback.height_1y_ago,
|
||||
&value.vocdd.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -3,7 +3,7 @@ use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::ValueFromHeight};
|
||||
use crate::{indexes, internal::AmountFromHeight};
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn forced_import(
|
||||
@@ -12,8 +12,13 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
vaulted_supply: ValueFromHeight::forced_import(db, "vaulted_supply", version, indexes)?,
|
||||
active_supply: ValueFromHeight::forced_import(db, "active_supply", version, indexes)?,
|
||||
vaulted_supply: AmountFromHeight::forced_import(
|
||||
db,
|
||||
"vaulted_supply",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
active_supply: AmountFromHeight::forced_import(db, "active_supply", version, indexes)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use brk_traversable::Traversable;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::ValueFromHeight;
|
||||
use crate::internal::AmountFromHeight;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub vaulted_supply: ValueFromHeight<M>,
|
||||
pub active_supply: ValueFromHeight<M>,
|
||||
pub vaulted_supply: AmountFromHeight<M>,
|
||||
pub active_supply: AmountFromHeight<M>,
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ impl Vecs {
|
||||
activity: &activity::Vecs,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let window_starts = blocks.count.window_starts();
|
||||
let window_starts = blocks.lookback.window_starts();
|
||||
|
||||
let all_metrics = &distribution.utxo_cohorts.all.metrics;
|
||||
let coinblocks_destroyed = &all_metrics.activity.coinblocks_destroyed;
|
||||
|
||||
Reference in New Issue
Block a user