Don't expose IndexDb throughout the crate

This commit is contained in:
Luke Parker
2024-08-27 00:44:11 -04:00
parent 9ab8ba0215
commit 2bddf00222
5 changed files with 42 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ use serai_in_instructions_primitives::{MAX_BATCH_SIZE, Batch};
use primitives::ReceivedOutput;
// TODO: Localize to ReportDb?
use crate::{db::ScannerDb, index::IndexDb, ScannerFeed, ContinuallyRan};
use crate::{db::ScannerDb, index, ScannerFeed, ContinuallyRan};
/*
This task produces Batches for notable blocks, with all InInstructions, in an ordered fashion.
@@ -65,8 +65,7 @@ impl<D: Db, S: ScannerFeed> ContinuallyRan for ReportTask<D, S> {
};
let network = S::NETWORK;
let block_hash =
IndexDb::block_id(&txn, b).expect("reporting block we didn't save the ID for");
let block_hash = index::block_id(&txn, b);
let mut batch_id = ScannerDb::<S>::acquire_batch_id(&mut txn);
// start with empty batch