mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
37 lines
1.1 KiB
Rust
37 lines
1.1 KiB
Rust
use brk_error::Result;
|
|
use brk_types::Version;
|
|
use vecdb::Database;
|
|
|
|
use super::Vecs;
|
|
use crate::{
|
|
indexes,
|
|
internal::{ComputedFromHeightCumulativeSum, ComputedFromHeightLast},
|
|
};
|
|
|
|
impl Vecs {
|
|
pub(crate) fn forced_import(db: &Database, version: Version, indexes: &indexes::Vecs) -> Result<Self> {
|
|
Ok(Self {
|
|
coinblocks_created: ComputedFromHeightCumulativeSum::forced_import(
|
|
db,
|
|
"coinblocks_created",
|
|
version,
|
|
indexes,
|
|
)?,
|
|
coinblocks_stored: ComputedFromHeightCumulativeSum::forced_import(
|
|
db,
|
|
"coinblocks_stored",
|
|
version,
|
|
indexes,
|
|
)?,
|
|
liveliness: ComputedFromHeightLast::forced_import(db, "liveliness", version, indexes)?,
|
|
vaultedness: ComputedFromHeightLast::forced_import(db, "vaultedness", version, indexes)?,
|
|
activity_to_vaultedness_ratio: ComputedFromHeightLast::forced_import(
|
|
db,
|
|
"activity_to_vaultedness_ratio",
|
|
version,
|
|
indexes,
|
|
)?,
|
|
})
|
|
}
|
|
}
|