computer: lazy part 1

This commit is contained in:
nym21
2025-05-01 17:25:59 +02:00
parent 700352ec45
commit c77aecbfce
26 changed files with 466 additions and 278 deletions

View File

@@ -26,14 +26,19 @@ pub struct Vecs {
}
impl Vecs {
pub fn import(path: &Path, fetch: bool, compressed: Compressed) -> color_eyre::Result<Self> {
pub fn import(
path: &Path,
indexer: &Indexer,
fetch: bool,
compressed: Compressed,
) -> color_eyre::Result<Self> {
fs::create_dir_all(path)?;
Ok(Self {
blocks: blocks::Vecs::forced_import(path, compressed)?,
indexes: indexes::Vecs::forced_import(path, compressed)?,
mining: mining::Vecs::forced_import(path, compressed)?,
transactions: transactions::Vecs::forced_import(path, compressed, fetch)?,
transactions: transactions::Vecs::forced_import(path, indexer, compressed, fetch)?,
marketprice: fetch.then(|| marketprice::Vecs::forced_import(path, compressed).unwrap()),
})
}