Replace scanner's BatchPublisher with a pair of DB channels

This commit is contained in:
Luke Parker
2024-09-08 23:42:18 -04:00
parent f07ec7bee0
commit 4152bcacb2
7 changed files with 152 additions and 61 deletions

View File

@@ -6,7 +6,7 @@ use serai_coins_primitives::{OutInstruction, OutInstructionWithBalance};
use primitives::task::ContinuallyRan;
use crate::{
db::{ScannerGlobalDb, SubstrateToEventualityDb},
db::{ScannerGlobalDb, SubstrateToEventualityDb, AcknowledgedBatch},
report, ScannerFeed, KeyFor,
};
@@ -79,6 +79,12 @@ impl<D: Db, S: ScannerFeed> ContinuallyRan for SubstrateTask<D, S> {
return Ok(made_progress);
};
{
let external_key_for_session_to_sign_batch =
report::take_external_key_for_session_to_sign_batch::<S>(&mut txn, batch_id).unwrap();
AcknowledgedBatch::send(&mut txn, &external_key_for_session_to_sign_batch, batch_id);
}
// Mark we made progress and handle this
made_progress = true;