mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 16:49:58 -07:00
global: big snapshot
This commit is contained in:
@@ -4,11 +4,7 @@ use brk_types::Version;
|
||||
use vecdb::{Database, EagerVec, ImportableVec};
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{
|
||||
indexes,
|
||||
internal::{ComputedTxDistribution, ValueDerivedTxFull},
|
||||
price,
|
||||
};
|
||||
use crate::{indexes, internal::{ComputedTxDistribution, ValueTxFull}, price};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(
|
||||
@@ -18,31 +14,11 @@ impl Vecs {
|
||||
indexes: &indexes::Vecs,
|
||||
price: Option<&price::Vecs>,
|
||||
) -> Result<Self> {
|
||||
let txindex_to_input_value = EagerVec::forced_import(db, "input_value", version)?;
|
||||
let txindex_to_output_value = EagerVec::forced_import(db, "output_value", version)?;
|
||||
let txindex_to_fee = EagerVec::forced_import(db, "fee", version)?;
|
||||
let txindex_to_fee_rate = EagerVec::forced_import(db, "fee_rate", version)?;
|
||||
|
||||
Ok(Self {
|
||||
txindex_to_input_value,
|
||||
txindex_to_output_value,
|
||||
txindex_to_fee: txindex_to_fee.clone(),
|
||||
txindex_to_fee_rate: txindex_to_fee_rate.clone(),
|
||||
indexes_to_fee: ValueDerivedTxFull::forced_import(
|
||||
db,
|
||||
"fee",
|
||||
version,
|
||||
indexes,
|
||||
indexer,
|
||||
price,
|
||||
&txindex_to_fee,
|
||||
)?,
|
||||
indexes_to_fee_rate: ComputedTxDistribution::forced_import(
|
||||
db,
|
||||
"fee_rate",
|
||||
version,
|
||||
indexes,
|
||||
)?,
|
||||
input_value: EagerVec::forced_import(db, "input_value", version)?,
|
||||
output_value: EagerVec::forced_import(db, "output_value", version)?,
|
||||
fee: ValueTxFull::forced_import(db, "fee", version, indexes, indexer, price)?,
|
||||
fee_rate: ComputedTxDistribution::forced_import(db, "fee_rate", version, indexes)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user