mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-24 17:38:09 -07:00
global: snapshot
This commit is contained in:
@@ -54,8 +54,8 @@ impl Vecs {
|
||||
|
||||
// 2. Compute unspendable supply = opreturn + unclaimed_rewards + genesis (at height 0)
|
||||
// Get reference to opreturn height vec for computing unspendable
|
||||
let opreturn_height = &self.opreturn.raw.sats.height;
|
||||
let unclaimed_height = &mining.rewards.unclaimed.raw.sats.height;
|
||||
let opreturn_height = &self.opreturn.base.sats.height;
|
||||
let unclaimed_height = &mining.rewards.unclaimed.base.sats.height;
|
||||
|
||||
self.unspendable.compute(
|
||||
starting_indexes.height,
|
||||
|
||||
@@ -7,7 +7,8 @@ use crate::{
|
||||
cointime, distribution, indexes,
|
||||
internal::{
|
||||
CachedWindowStarts, LazyAmountPerBlock, LazyFiatPerBlock,
|
||||
LazyRollingDeltasFiatFromHeight, PercentPerBlock, RollingWindows, finalize_db, open_db,
|
||||
LazyRollingDeltasFiatFromHeight, PercentPerBlock, RollingWindows,
|
||||
db_utils::{finalize_db, open_db},
|
||||
},
|
||||
supply::burned,
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ impl Vecs {
|
||||
self.btc.height.compute_rolling_ratio(
|
||||
starting_indexes.height,
|
||||
&blocks.lookback._1y,
|
||||
&transactions.volume.sent_sum.raw.sats.height,
|
||||
&transactions.volume.sent_sum.base.sats.height,
|
||||
&circulating_supply.sats.height,
|
||||
exit,
|
||||
)?;
|
||||
@@ -30,7 +30,7 @@ impl Vecs {
|
||||
self.usd.height.compute_rolling_ratio(
|
||||
starting_indexes.height,
|
||||
&blocks.lookback._1y,
|
||||
&transactions.volume.sent_sum.raw.usd.height,
|
||||
&transactions.volume.sent_sum.base.usd.height,
|
||||
&circulating_supply.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -3,7 +3,7 @@ use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::ComputedPerBlock};
|
||||
use crate::{indexes, internal::PerBlock};
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn forced_import(
|
||||
@@ -12,8 +12,8 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
btc: ComputedPerBlock::forced_import(db, "velocity_btc", version, indexes)?,
|
||||
usd: ComputedPerBlock::forced_import(db, "velocity_usd", version, indexes)?,
|
||||
btc: PerBlock::forced_import(db, "velocity_btc", version, indexes)?,
|
||||
usd: PerBlock::forced_import(db, "velocity_usd", version, indexes)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ use brk_traversable::Traversable;
|
||||
use brk_types::StoredF64;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::ComputedPerBlock;
|
||||
use crate::internal::PerBlock;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub btc: ComputedPerBlock<StoredF64, M>,
|
||||
pub usd: ComputedPerBlock<StoredF64, M>,
|
||||
pub btc: PerBlock<StoredF64, M>,
|
||||
pub usd: PerBlock<StoredF64, M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user