mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 13:39:25 +00:00
Provide a way to create the machine
The BasicQueue returned obscures the TendermintImport struct. Accordingly, a Future scoped with access is returned upwards, which when awaited will create the machine. This makes creating the machine optional while maintaining scope boundaries. Is sufficient to create a 1-node net which produces and finalizes blocks.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
use std::{sync::Arc, future::Future};
|
||||
|
||||
use sp_api::TransactionFor;
|
||||
use sp_consensus::Error;
|
||||
|
||||
use sc_executor::{NativeVersion, NativeExecutionDispatch, NativeElseWasmExecutor};
|
||||
use sc_transaction_pool::FullPool;
|
||||
@@ -50,8 +49,8 @@ pub fn import_queue(
|
||||
client: Arc<FullClient>,
|
||||
pool: Arc<FullPool<Block, FullClient>>,
|
||||
registry: Option<&Registry>,
|
||||
) -> Result<TendermintImportQueue<Block, TransactionFor<FullClient, Block>>, Error> {
|
||||
Ok(import_queue::import_queue(
|
||||
) -> (impl Future<Output = ()>, TendermintImportQueue<Block, TransactionFor<FullClient, Block>>) {
|
||||
import_queue::import_queue(
|
||||
client.clone(),
|
||||
client.clone(),
|
||||
Arc::new(|_, _| async { Ok(sp_timestamp::InherentDataProvider::from_system_time()) }),
|
||||
@@ -64,18 +63,7 @@ pub fn import_queue(
|
||||
),
|
||||
&task_manager.spawn_essential_handle(),
|
||||
registry,
|
||||
))
|
||||
}
|
||||
|
||||
// If we're an authority, produce blocks
|
||||
pub fn authority(
|
||||
task_manager: &TaskManager,
|
||||
client: Arc<FullClient>,
|
||||
network: Arc<sc_network::NetworkService<Block, <Block as sp_runtime::traits::Block>::Hash>>,
|
||||
pool: Arc<FullPool<Block, FullClient>>,
|
||||
registry: Option<&Registry>,
|
||||
) {
|
||||
todo!()
|
||||
)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user