mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-24 16:54:47 -07:00
global: snapshot
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
mod fjalls;
|
||||
mod storable_vecs;
|
||||
mod stores;
|
||||
mod vecs;
|
||||
|
||||
pub use fjalls::*;
|
||||
pub use storable_vecs::*;
|
||||
pub use stores::*;
|
||||
pub use vecs::*;
|
||||
|
||||
@@ -2,14 +2,14 @@ use std::path::Path;
|
||||
|
||||
use brk_core::{AddressindexTxoutindex, Unit};
|
||||
use brk_indexer::Store;
|
||||
use storable_vec::Version;
|
||||
use brk_vec::Version;
|
||||
|
||||
pub struct Fjalls {
|
||||
pub struct Stores {
|
||||
pub address_to_utxos_received: Store<AddressindexTxoutindex, Unit>,
|
||||
pub address_to_utxos_spent: Store<AddressindexTxoutindex, Unit>,
|
||||
}
|
||||
|
||||
impl Fjalls {
|
||||
impl Stores {
|
||||
pub fn import(path: &Path) -> color_eyre::Result<Self> {
|
||||
let address_to_utxos_received = Store::import(&path.join("address_to_utxos_received"), Version::from(1))?;
|
||||
let address_to_utxos_spent = Store::import(&path.join("address_to_utxos_spent"), Version::from(1))?;
|
||||
@@ -4,13 +4,13 @@ use brk_core::{
|
||||
Addressindex, Cents, Close, Date, Dateindex, Dollars, Feerate, Height, High, Low, Open, Sats, Timestamp, Txindex,
|
||||
Txinindex, Txoutindex,
|
||||
};
|
||||
use storable_vec::{StorableVec, Version};
|
||||
use brk_vec::{StorableVec, Version};
|
||||
|
||||
// mod base;
|
||||
|
||||
// use base::*;
|
||||
|
||||
pub struct StorableVecs<const MODE: u8> {
|
||||
pub struct Vecs<const MODE: u8> {
|
||||
pub dateindex_to_first_height: StorableVec<Dateindex, Height, MODE>,
|
||||
// pub dateindex_to_last_height: StorableVec<Dateindex, Height, MODE>,
|
||||
// pub height_to_block_interval: StorableVec<Height, Timestamp, MODE>,
|
||||
@@ -56,7 +56,7 @@ pub struct StorableVecs<const MODE: u8> {
|
||||
pub txindex_to_outputs_sum: StorableVec<Txindex, Sats, MODE>,
|
||||
}
|
||||
|
||||
impl<const MODE: u8> StorableVecs<MODE> {
|
||||
impl<const MODE: u8> Vecs<MODE> {
|
||||
pub fn import(path: &Path) -> color_eyre::Result<Self> {
|
||||
fs::create_dir_all(path)?;
|
||||
|
||||
Reference in New Issue
Block a user