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