mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
global: big snapshot
This commit is contained in:
@@ -4,7 +4,7 @@ use brk_types::StoredU64;
|
||||
use vecdb::{Exit, TypedVecIterator};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, ComputeIndexes};
|
||||
use crate::{ComputeIndexes, indexes};
|
||||
|
||||
impl Vecs {
|
||||
pub fn compute(
|
||||
@@ -14,147 +14,146 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.indexes_to_p2a_count
|
||||
self.p2a.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.addresses.first_p2aaddressindex,
|
||||
&indexer.vecs.addresses.p2abytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.p2ms
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2aaddressindex,
|
||||
&indexer.vecs.address.p2aaddressindex_to_p2abytes,
|
||||
&indexer.vecs.scripts.first_p2msoutputindex,
|
||||
&indexer.vecs.scripts.p2ms_to_txindex,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2ms_count
|
||||
self.p2pk33
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.output.height_to_first_p2msoutputindex,
|
||||
&indexer.vecs.output.p2msoutputindex_to_txindex,
|
||||
&indexer.vecs.addresses.first_p2pk33addressindex,
|
||||
&indexer.vecs.addresses.p2pk33bytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2pk33_count
|
||||
self.p2pk65
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2pk33addressindex,
|
||||
&indexer.vecs.address.p2pk33addressindex_to_p2pk33bytes,
|
||||
&indexer.vecs.addresses.first_p2pk65addressindex,
|
||||
&indexer.vecs.addresses.p2pk65bytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2pk65_count
|
||||
self.p2pkh
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2pk65addressindex,
|
||||
&indexer.vecs.address.p2pk65addressindex_to_p2pk65bytes,
|
||||
&indexer.vecs.addresses.first_p2pkhaddressindex,
|
||||
&indexer.vecs.addresses.p2pkhbytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2pkh_count
|
||||
self.p2sh
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2pkhaddressindex,
|
||||
&indexer.vecs.address.p2pkhaddressindex_to_p2pkhbytes,
|
||||
&indexer.vecs.addresses.first_p2shaddressindex,
|
||||
&indexer.vecs.addresses.p2shbytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2sh_count
|
||||
self.p2tr
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2shaddressindex,
|
||||
&indexer.vecs.address.p2shaddressindex_to_p2shbytes,
|
||||
&indexer.vecs.addresses.first_p2traddressindex,
|
||||
&indexer.vecs.addresses.p2trbytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2tr_count
|
||||
self.p2wpkh
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2traddressindex,
|
||||
&indexer.vecs.address.p2traddressindex_to_p2trbytes,
|
||||
&indexer.vecs.addresses.first_p2wpkhaddressindex,
|
||||
&indexer.vecs.addresses.p2wpkhbytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2wpkh_count
|
||||
self.p2wsh
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2wpkhaddressindex,
|
||||
&indexer.vecs.address.p2wpkhaddressindex_to_p2wpkhbytes,
|
||||
&indexer.vecs.addresses.first_p2wshaddressindex,
|
||||
&indexer.vecs.addresses.p2wshbytes,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_p2wsh_count
|
||||
self.opreturn
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.address.height_to_first_p2wshaddressindex,
|
||||
&indexer.vecs.address.p2wshaddressindex_to_p2wshbytes,
|
||||
&indexer.vecs.scripts.first_opreturnindex,
|
||||
&indexer.vecs.scripts.opreturn_to_txindex,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_opreturn_count
|
||||
self.unknownoutput
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.output.height_to_first_opreturnindex,
|
||||
&indexer.vecs.output.opreturnindex_to_txindex,
|
||||
&indexer.vecs.scripts.first_unknownoutputindex,
|
||||
&indexer.vecs.scripts.unknown_to_txindex,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_unknownoutput_count
|
||||
self.emptyoutput
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.output.height_to_first_unknownoutputindex,
|
||||
&indexer.vecs.output.unknownoutputindex_to_txindex,
|
||||
&indexer.vecs.scripts.first_emptyoutputindex,
|
||||
&indexer.vecs.scripts.empty_to_txindex,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
self.indexes_to_emptyoutput_count
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_count_from_indexes(
|
||||
starting_indexes.height,
|
||||
&indexer.vecs.output.height_to_first_emptyoutputindex,
|
||||
&indexer.vecs.output.emptyoutputindex_to_txindex,
|
||||
exit,
|
||||
)?;
|
||||
Ok(())
|
||||
})?;
|
||||
// Compute segwit = p2wpkh + p2wsh + p2tr
|
||||
let mut p2wsh_iter = self.p2wsh.height.into_iter();
|
||||
let mut p2tr_iter = self.p2tr.height.into_iter();
|
||||
|
||||
// Compute segwit_count = p2wpkh + p2wsh + p2tr
|
||||
let mut p2wsh_iter = self.indexes_to_p2wsh_count.height.into_iter();
|
||||
let mut p2tr_iter = self.indexes_to_p2tr_count.height.into_iter();
|
||||
|
||||
self.indexes_to_segwit_count
|
||||
self.segwit
|
||||
.compute_all(indexes, starting_indexes, exit, |v| {
|
||||
v.compute_transform(
|
||||
starting_indexes.height,
|
||||
&self.indexes_to_p2wpkh_count.height,
|
||||
&self.p2wpkh.height,
|
||||
|(h, p2wpkh, ..)| {
|
||||
let sum = *p2wpkh + *p2wsh_iter.get_unwrap(h) + *p2tr_iter.get_unwrap(h);
|
||||
(h, StoredU64::from(sum))
|
||||
|
||||
@@ -5,9 +5,7 @@ use vecdb::{Database, IterableCloneableVec};
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{
|
||||
ComputedBlockFull, BinaryBlockFull, PercentageU64F32,
|
||||
},
|
||||
internal::{BinaryBlockFull, ComputedBlockFull, PercentageU64F32},
|
||||
outputs,
|
||||
};
|
||||
|
||||
@@ -18,122 +16,65 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
outputs: &outputs::Vecs,
|
||||
) -> Result<Self> {
|
||||
let indexes_to_p2a_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2a_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2ms_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2ms_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2pk33_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2pk33_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2pk65_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2pk65_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2pkh_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2pkh_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2sh_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2sh_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2tr_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2tr_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2wpkh_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2wpkh_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let indexes_to_p2wsh_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"p2wsh_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let p2a = ComputedBlockFull::forced_import(db, "p2a_count", version, indexes)?;
|
||||
let p2ms = ComputedBlockFull::forced_import(db, "p2ms_count", version, indexes)?;
|
||||
let p2pk33 = ComputedBlockFull::forced_import(db, "p2pk33_count", version, indexes)?;
|
||||
let p2pk65 = ComputedBlockFull::forced_import(db, "p2pk65_count", version, indexes)?;
|
||||
let p2pkh = ComputedBlockFull::forced_import(db, "p2pkh_count", version, indexes)?;
|
||||
let p2sh = ComputedBlockFull::forced_import(db, "p2sh_count", version, indexes)?;
|
||||
let p2tr = ComputedBlockFull::forced_import(db, "p2tr_count", version, indexes)?;
|
||||
let p2wpkh = ComputedBlockFull::forced_import(db, "p2wpkh_count", version, indexes)?;
|
||||
let p2wsh = ComputedBlockFull::forced_import(db, "p2wsh_count", version, indexes)?;
|
||||
|
||||
// Aggregate counts (computed from per-type counts)
|
||||
let indexes_to_segwit_count = ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"segwit_count",
|
||||
version,
|
||||
indexes,
|
||||
)?;
|
||||
let segwit = ComputedBlockFull::forced_import(db, "segwit_count", version, indexes)?;
|
||||
|
||||
// Adoption ratios (lazy)
|
||||
// Uses outputs.count.indexes_to_count as denominator (total output count)
|
||||
// Uses outputs.count.count as denominator (total output count)
|
||||
// At height level: per-block ratio; at dateindex level: sum-based ratio (% of new outputs)
|
||||
let indexes_to_taproot_adoption =
|
||||
BinaryBlockFull::from_height_and_txindex::<PercentageU64F32>(
|
||||
"taproot_adoption",
|
||||
version,
|
||||
indexes_to_p2tr_count.height.boxed_clone(),
|
||||
outputs.count.indexes_to_count.height.sum_cum.sum.0.boxed_clone(),
|
||||
&indexes_to_p2tr_count,
|
||||
&outputs.count.indexes_to_count,
|
||||
);
|
||||
let indexes_to_segwit_adoption =
|
||||
BinaryBlockFull::from_height_and_txindex::<PercentageU64F32>(
|
||||
"segwit_adoption",
|
||||
version,
|
||||
indexes_to_segwit_count.height.boxed_clone(),
|
||||
outputs.count.indexes_to_count.height.sum_cum.sum.0.boxed_clone(),
|
||||
&indexes_to_segwit_count,
|
||||
&outputs.count.indexes_to_count,
|
||||
);
|
||||
let taproot_adoption = BinaryBlockFull::from_height_and_txindex::<PercentageU64F32>(
|
||||
"taproot_adoption",
|
||||
version,
|
||||
p2tr.height.boxed_clone(),
|
||||
outputs.count.total_count.height.sum_cum.sum.0.boxed_clone(),
|
||||
&p2tr,
|
||||
&outputs.count.total_count,
|
||||
);
|
||||
let segwit_adoption = BinaryBlockFull::from_height_and_txindex::<PercentageU64F32>(
|
||||
"segwit_adoption",
|
||||
version,
|
||||
segwit.height.boxed_clone(),
|
||||
outputs.count.total_count.height.sum_cum.sum.0.boxed_clone(),
|
||||
&segwit,
|
||||
&outputs.count.total_count,
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_p2a_count,
|
||||
indexes_to_p2ms_count,
|
||||
indexes_to_p2pk33_count,
|
||||
indexes_to_p2pk65_count,
|
||||
indexes_to_p2pkh_count,
|
||||
indexes_to_p2sh_count,
|
||||
indexes_to_p2tr_count,
|
||||
indexes_to_p2wpkh_count,
|
||||
indexes_to_p2wsh_count,
|
||||
indexes_to_opreturn_count: ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"opreturn_count",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
indexes_to_emptyoutput_count: ComputedBlockFull::forced_import(
|
||||
p2a,
|
||||
p2ms,
|
||||
p2pk33,
|
||||
p2pk65,
|
||||
p2pkh,
|
||||
p2sh,
|
||||
p2tr,
|
||||
p2wpkh,
|
||||
p2wsh,
|
||||
opreturn: ComputedBlockFull::forced_import(db, "opreturn_count", version, indexes)?,
|
||||
emptyoutput: ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"emptyoutput_count",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
indexes_to_unknownoutput_count: ComputedBlockFull::forced_import(
|
||||
unknownoutput: ComputedBlockFull::forced_import(
|
||||
db,
|
||||
"unknownoutput_count",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
indexes_to_segwit_count,
|
||||
indexes_to_taproot_adoption,
|
||||
indexes_to_segwit_adoption,
|
||||
segwit,
|
||||
taproot_adoption,
|
||||
segwit_adoption,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::{StoredF32, StoredU64};
|
||||
|
||||
use crate::internal::{ComputedBlockFull, BinaryBlockFull};
|
||||
use crate::internal::{BinaryBlockFull, ComputedBlockFull};
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
// Per-type output counts
|
||||
pub indexes_to_p2a_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2ms_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2pk33_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2pk65_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2pkh_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2sh_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2tr_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2wpkh_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_p2wsh_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_opreturn_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_emptyoutput_count: ComputedBlockFull<StoredU64>,
|
||||
pub indexes_to_unknownoutput_count: ComputedBlockFull<StoredU64>,
|
||||
pub p2a: ComputedBlockFull<StoredU64>,
|
||||
pub p2ms: ComputedBlockFull<StoredU64>,
|
||||
pub p2pk33: ComputedBlockFull<StoredU64>,
|
||||
pub p2pk65: ComputedBlockFull<StoredU64>,
|
||||
pub p2pkh: ComputedBlockFull<StoredU64>,
|
||||
pub p2sh: ComputedBlockFull<StoredU64>,
|
||||
pub p2tr: ComputedBlockFull<StoredU64>,
|
||||
pub p2wpkh: ComputedBlockFull<StoredU64>,
|
||||
pub p2wsh: ComputedBlockFull<StoredU64>,
|
||||
pub opreturn: ComputedBlockFull<StoredU64>,
|
||||
pub emptyoutput: ComputedBlockFull<StoredU64>,
|
||||
pub unknownoutput: ComputedBlockFull<StoredU64>,
|
||||
|
||||
// Aggregate counts
|
||||
/// SegWit output count (p2wpkh + p2wsh + p2tr)
|
||||
pub indexes_to_segwit_count: ComputedBlockFull<StoredU64>,
|
||||
pub segwit: ComputedBlockFull<StoredU64>,
|
||||
|
||||
// Adoption ratios (lazy)
|
||||
// Denominator is outputs.count.indexes_to_count (total output count)
|
||||
/// Taproot adoption: p2tr / total_outputs * 100
|
||||
pub indexes_to_taproot_adoption: BinaryBlockFull<StoredF32, StoredU64, StoredU64>,
|
||||
/// SegWit adoption: segwit / total_outputs * 100
|
||||
pub indexes_to_segwit_adoption: BinaryBlockFull<StoredF32, StoredU64, StoredU64>,
|
||||
// Adoption ratios
|
||||
pub taproot_adoption: BinaryBlockFull<StoredF32, StoredU64, StoredU64>,
|
||||
pub segwit_adoption: BinaryBlockFull<StoredF32, StoredU64, StoredU64>,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use brk_types::{Height, OutputType, Sats, TxOutIndex};
|
||||
use vecdb::{AnyStoredVec, AnyVec, Exit, GenericStoredVec, TypedVecIterator, VecIndex};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, price, ComputeIndexes};
|
||||
use crate::{ComputeIndexes, indexes, price};
|
||||
|
||||
impl Vecs {
|
||||
pub fn compute(
|
||||
@@ -15,20 +15,16 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
self.indexes_to_opreturn_value.compute_all(
|
||||
indexes,
|
||||
price,
|
||||
starting_indexes,
|
||||
exit,
|
||||
|height_vec| {
|
||||
self.opreturn
|
||||
.compute_all(indexes, price, starting_indexes, exit, |height_vec| {
|
||||
// Validate computed versions against dependencies
|
||||
let dep_version = indexer.vecs.txout.height_to_first_txoutindex.version()
|
||||
+ indexer.vecs.txout.txoutindex_to_outputtype.version()
|
||||
+ indexer.vecs.txout.txoutindex_to_value.version();
|
||||
let dep_version = indexer.vecs.outputs.first_txoutindex.version()
|
||||
+ indexer.vecs.outputs.outputtype.version()
|
||||
+ indexer.vecs.outputs.value.version();
|
||||
height_vec.validate_computed_version_or_reset(dep_version)?;
|
||||
|
||||
// Get target height
|
||||
let target_len = indexer.vecs.txout.height_to_first_txoutindex.len();
|
||||
let target_len = indexer.vecs.outputs.first_txoutindex.len();
|
||||
if target_len == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
@@ -45,10 +41,9 @@ impl Vecs {
|
||||
|
||||
// Prepare iterators
|
||||
let mut height_to_first_txoutindex =
|
||||
indexer.vecs.txout.height_to_first_txoutindex.iter()?;
|
||||
let mut txoutindex_to_outputtype =
|
||||
indexer.vecs.txout.txoutindex_to_outputtype.iter()?;
|
||||
let mut txoutindex_to_value = indexer.vecs.txout.txoutindex_to_value.iter()?;
|
||||
indexer.vecs.outputs.first_txoutindex.iter()?;
|
||||
let mut txoutindex_to_outputtype = indexer.vecs.outputs.outputtype.iter()?;
|
||||
let mut txoutindex_to_value = indexer.vecs.outputs.value.iter()?;
|
||||
|
||||
// Iterate blocks
|
||||
for h in starting_height.to_usize()..=target_height.to_usize() {
|
||||
@@ -59,7 +54,7 @@ impl Vecs {
|
||||
let next_first_txoutindex = if height < target_height {
|
||||
height_to_first_txoutindex.get_unwrap(height.incremented())
|
||||
} else {
|
||||
TxOutIndex::from(indexer.vecs.txout.txoutindex_to_value.len())
|
||||
TxOutIndex::from(indexer.vecs.outputs.value.len())
|
||||
};
|
||||
|
||||
// Sum opreturn values
|
||||
@@ -80,8 +75,7 @@ impl Vecs {
|
||||
height_vec.write()?;
|
||||
|
||||
Ok(())
|
||||
},
|
||||
)?;
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -12,16 +12,14 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
compute_dollars: bool,
|
||||
) -> Result<Self> {
|
||||
let indexes_to_opreturn_value = ValueBlockFull::forced_import(
|
||||
db,
|
||||
"opreturn_value",
|
||||
version,
|
||||
indexes,
|
||||
compute_dollars,
|
||||
)?;
|
||||
|
||||
Ok(Self {
|
||||
indexes_to_opreturn_value,
|
||||
opreturn: ValueBlockFull::forced_import(
|
||||
db,
|
||||
"opreturn_value",
|
||||
version,
|
||||
indexes,
|
||||
compute_dollars,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ use crate::internal::ValueBlockFull;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub indexes_to_opreturn_value: ValueBlockFull,
|
||||
pub opreturn: ValueBlockFull,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user