mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
computer: snapshot
This commit is contained in:
@@ -18,7 +18,7 @@ impl Vecs {
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.count
|
||||
.compute(indexer, &blocks.count, starting_indexes, exit)?;
|
||||
.compute(indexer, &blocks.lookback, starting_indexes, exit)?;
|
||||
|
||||
self.value
|
||||
.compute(indexer, prices, starting_indexes, exit)?;
|
||||
|
||||
@@ -10,11 +10,11 @@ impl Vecs {
|
||||
pub(crate) fn compute(
|
||||
&mut self,
|
||||
indexer: &Indexer,
|
||||
count_vecs: &blocks::CountVecs,
|
||||
lookback: &blocks::LookbackVecs,
|
||||
starting_indexes: &Indexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let window_starts = count_vecs.window_starts();
|
||||
let window_starts = lookback.window_starts();
|
||||
|
||||
self.p2a
|
||||
.compute(starting_indexes.height, &window_starts, exit, |v| {
|
||||
|
||||
@@ -3,7 +3,7 @@ use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::ValueFromHeightCumulative};
|
||||
use crate::{indexes, internal::AmountFromHeightCumulative};
|
||||
|
||||
impl Vecs {
|
||||
pub(crate) fn forced_import(
|
||||
@@ -12,7 +12,7 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
) -> Result<Self> {
|
||||
Ok(Self {
|
||||
opreturn: ValueFromHeightCumulative::forced_import(
|
||||
opreturn: AmountFromHeightCumulative::forced_import(
|
||||
db,
|
||||
"opreturn_value",
|
||||
version,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use brk_traversable::Traversable;
|
||||
use vecdb::{Rw, StorageMode};
|
||||
|
||||
use crate::internal::ValueFromHeightCumulative;
|
||||
use crate::internal::AmountFromHeightCumulative;
|
||||
|
||||
#[derive(Traversable)]
|
||||
pub struct Vecs<M: StorageMode = Rw> {
|
||||
pub opreturn: ValueFromHeightCumulative<M>,
|
||||
pub opreturn: AmountFromHeightCumulative<M>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user