mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-03 23:33:40 -07:00
global: snapshot
This commit is contained in:
@@ -3,7 +3,7 @@ use brk_types::{Cents, Dollars, OHLCCents, OHLCDollars, OHLCSats, Sats};
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::{
|
||||
ComputedPerBlock, Resolutions, EagerIndexes, LazyEagerIndexes, LazyPerBlock,
|
||||
PerBlock, Resolutions, EagerIndexes, LazyEagerIndexes, LazyPerBlock,
|
||||
};
|
||||
|
||||
use super::ohlcs::{LazyOhlcVecs, OhlcVecs};
|
||||
@@ -39,7 +39,7 @@ pub struct OhlcByUnit<M: StorageMode = Rw> {
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct PriceByUnit<M: StorageMode = Rw> {
|
||||
pub cents: ComputedPerBlock<Cents, M>,
|
||||
pub cents: PerBlock<Cents, M>,
|
||||
pub usd: LazyPerBlock<Dollars, Cents>,
|
||||
pub sats: LazyPerBlock<Sats, Cents>,
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ use vecdb::{Database, ReadableCloneableVec, Rw, StorageMode};
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
CentsUnsignedToDollars, CentsUnsignedToSats, ComputedPerBlock, Resolutions,
|
||||
CentsUnsignedToDollars, CentsUnsignedToSats, PerBlock, Resolutions,
|
||||
EagerIndexes, LazyEagerIndexes, LazyPerBlock, OhlcCentsToDollars, OhlcCentsToSats,
|
||||
finalize_db, open_db,
|
||||
db_utils::{finalize_db, open_db},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ impl Vecs {
|
||||
) -> brk_error::Result<Self> {
|
||||
let version = version + Version::new(11);
|
||||
|
||||
let price_cents = ComputedPerBlock::forced_import(db, "price_cents", version, indexes)?;
|
||||
let price_cents = PerBlock::forced_import(db, "price_cents", version, indexes)?;
|
||||
|
||||
let open_cents = EagerIndexes::forced_import(db, "price_open_cents", version)?;
|
||||
let high_cents = EagerIndexes::forced_import(db, "price_high_cents", version)?;
|
||||
|
||||
Reference in New Issue
Block a user