mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-28 19:28:11 -07:00
global: snapshot
This commit is contained in:
@@ -3,16 +3,16 @@ use brk_types::Version;
|
||||
use vecdb::Database;
|
||||
|
||||
use super::Vecs;
|
||||
use crate::{indexes, internal::ComputedBlockLast};
|
||||
use crate::{indexes, internal::ComputedFromHeightLast};
|
||||
|
||||
impl Vecs {
|
||||
pub fn forced_import(db: &Database, version: Version, indexes: &indexes::Vecs) -> Result<Self> {
|
||||
Ok(Self {
|
||||
thermo_cap: ComputedBlockLast::forced_import(db, "thermo_cap", version, indexes)?,
|
||||
investor_cap: ComputedBlockLast::forced_import(db, "investor_cap", version, indexes)?,
|
||||
vaulted_cap: ComputedBlockLast::forced_import(db, "vaulted_cap", version, indexes)?,
|
||||
active_cap: ComputedBlockLast::forced_import(db, "active_cap", version, indexes)?,
|
||||
cointime_cap: ComputedBlockLast::forced_import(db, "cointime_cap", version, indexes)?,
|
||||
thermo_cap: ComputedFromHeightLast::forced_import(db, "thermo_cap", version, indexes)?,
|
||||
investor_cap: ComputedFromHeightLast::forced_import(db, "investor_cap", version, indexes)?,
|
||||
vaulted_cap: ComputedFromHeightLast::forced_import(db, "vaulted_cap", version, indexes)?,
|
||||
active_cap: ComputedFromHeightLast::forced_import(db, "active_cap", version, indexes)?,
|
||||
cointime_cap: ComputedFromHeightLast::forced_import(db, "cointime_cap", version, indexes)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use brk_traversable::Traversable;
|
||||
use brk_types::Dollars;
|
||||
|
||||
use crate::internal::ComputedBlockLast;
|
||||
use crate::internal::ComputedFromHeightLast;
|
||||
|
||||
#[derive(Clone, Traversable)]
|
||||
pub struct Vecs {
|
||||
pub thermo_cap: ComputedBlockLast<Dollars>,
|
||||
pub investor_cap: ComputedBlockLast<Dollars>,
|
||||
pub vaulted_cap: ComputedBlockLast<Dollars>,
|
||||
pub active_cap: ComputedBlockLast<Dollars>,
|
||||
pub cointime_cap: ComputedBlockLast<Dollars>,
|
||||
pub thermo_cap: ComputedFromHeightLast<Dollars>,
|
||||
pub investor_cap: ComputedFromHeightLast<Dollars>,
|
||||
pub vaulted_cap: ComputedFromHeightLast<Dollars>,
|
||||
pub active_cap: ComputedFromHeightLast<Dollars>,
|
||||
pub cointime_cap: ComputedFromHeightLast<Dollars>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user