Flesh out Coordinator main

Lot of TODOs as the APIs are all being routed together.
This commit is contained in:
Luke Parker
2025-01-10 02:24:24 -05:00
parent 091d485fd8
commit cbe83956aa
6 changed files with 347 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
use std::future::Future;
use core::future::Future;
use std::sync::Arc;
use futures::stream::{StreamExt, FuturesOrdered};
@@ -20,14 +21,14 @@ create_db!(
/// The event stream for canonical events.
pub struct CanonicalEventStream<D: Db> {
db: D,
serai: Serai,
serai: Arc<Serai>,
}
impl<D: Db> CanonicalEventStream<D> {
/// Create a new canonical event stream.
///
/// Only one of these may exist over the provided database.
pub fn new(db: D, serai: Serai) -> Self {
pub fn new(db: D, serai: Arc<Serai>) -> Self {
Self { db, serai }
}
}