Skip to content

Commit 21527a9

Browse files
committed
Fix compilation
1 parent 64adce1 commit 21527a9

File tree

1 file changed

+80
-88
lines changed

1 file changed

+80
-88
lines changed

node/src/service.rs

Lines changed: 80 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,41 @@ type GrandpaBlockImport<B, C> =
5353
sc_consensus_grandpa::GrandpaBlockImport<FullBackend<B>, B, C, FullSelectChain<B>>;
5454
type GrandpaLinkHalf<B, C> = sc_consensus_grandpa::LinkHalf<B, C, FullSelectChain<B>>;
5555

56-
pub fn new_partial<B, RA, HF, BIQ>(
56+
pub fn new_partial<BIQ>(
5757
config: &Configuration,
5858
eth_config: &EthConfiguration,
5959
build_import_queue: BIQ,
6060
) -> Result<
6161
PartialComponents<
62-
FullClient<B, RA, HF>,
63-
FullBackend<B>,
64-
FullSelectChain<B>,
65-
BasicQueue<B>,
66-
FullPool<B, FullClient<B, RA, HF>>,
62+
Client,
63+
FullBackend<Block>,
64+
FullSelectChain<Block>,
65+
BasicQueue<Block>,
66+
FullPool<Block, Client>,
6767
(
6868
Option<Telemetry>,
69-
BoxBlockImport<B>,
70-
GrandpaLinkHalf<B, FullClient<B, RA, HF>>,
71-
FrontierBackend<B, FullClient<B, RA, HF>>,
72-
Arc<dyn StorageOverride<B>>,
69+
BoxBlockImport<Block>,
70+
GrandpaLinkHalf<Block, Client>,
71+
FrontierBackend<Block, Client>,
72+
Arc<dyn StorageOverride<Block>>,
7373
),
7474
>,
7575
ServiceError,
7676
>
7777
where
78-
B: BlockT<Hash = H256>,
79-
RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
80-
RA: Send + Sync + 'static,
81-
RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
82-
HF: HostFunctionsT + 'static,
78+
// B: BlockT<Hash = H256>,
79+
// RA: ConstructRuntimeApi<Block, Client>,
80+
// RA: Send + Sync + 'static,
81+
// RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
82+
// HF: HostFunctionsT + 'static,
8383
BIQ: FnOnce(
84-
Arc<FullClient<B, RA, HF>>,
84+
Arc<Client>,
8585
&Configuration,
8686
&EthConfiguration,
8787
&TaskManager,
8888
Option<TelemetryHandle>,
89-
GrandpaBlockImport<B, FullClient<B, RA, HF>>,
90-
) -> Result<(BasicQueue<B>, BoxBlockImport<B>), ServiceError>,
89+
GrandpaBlockImport<Block, Client>,
90+
) -> Result<(BasicQueue<Block>, BoxBlockImport<Block>), ServiceError>,
9191
{
9292
let telemetry = config
9393
.telemetry_endpoints
@@ -100,12 +100,13 @@ where
100100
})
101101
.transpose()?;
102102

103-
let executor = sc_service::new_wasm_executor::<HostFunctions>(&config.executor);
104-
let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::<B, RA, _>(
105-
config,
106-
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
107-
executor,
108-
)?;
103+
let executor = sc_service::new_wasm_executor(&config.executor);
104+
let (client, backend, keystore_container, task_manager) =
105+
sc_service::new_full_parts::<Block, RuntimeApi, _>(
106+
config,
107+
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
108+
executor,
109+
)?;
109110
let client = Arc::new(client);
110111

111112
let telemetry = telemetry.map(|(worker, telemetry)| {
@@ -124,7 +125,7 @@ where
124125
telemetry.as_ref().map(|x| x.handle()),
125126
)?;
126127

127-
let storage_override = Arc::new(StorageOverrideHandler::<B, _, _>::new(client.clone()));
128+
let storage_override = Arc::new(StorageOverrideHandler::<_, _, _>::new(client.clone()));
128129
let frontier_backend = match eth_config.frontier_backend_type {
129130
BackendType::KeyValue => FrontierBackend::KeyValue(Arc::new(fc_db::kv::Backend::open(
130131
Arc::clone(&client),
@@ -190,21 +191,21 @@ where
190191
}
191192

192193
/// Build the import queue for the template runtime (aura + grandpa).
193-
pub fn build_aura_grandpa_import_queue<B, RA, HF>(
194-
client: Arc<FullClient<B, RA, HF>>,
194+
pub fn build_aura_grandpa_import_queue(
195+
client: Arc<Client>,
195196
config: &Configuration,
196197
eth_config: &EthConfiguration,
197198
task_manager: &TaskManager,
198199
telemetry: Option<TelemetryHandle>,
199-
grandpa_block_import: GrandpaBlockImport<B, FullClient<B, RA, HF>>,
200-
) -> Result<(BasicQueue<B>, BoxBlockImport<B>), ServiceError>
200+
grandpa_block_import: GrandpaBlockImport<Block, Client>,
201+
) -> Result<(BasicQueue<Block>, BoxBlockImport<Block>), ServiceError>
201202
where
202-
B: BlockT,
203-
NumberFor<B>: BlockNumberOps,
204-
RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
205-
RA: Send + Sync + 'static,
206-
RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
207-
HF: HostFunctionsT + 'static,
203+
// B: BlockT,
204+
NumberFor<Block>: BlockNumberOps,
205+
// RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
206+
// RA: Send + Sync + 'static,
207+
// RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
208+
// HF: HostFunctionsT + 'static,
208209
{
209210
let frontier_block_import =
210211
FrontierBlockImport::new(grandpa_block_import.clone(), client.clone());
@@ -241,20 +242,20 @@ where
241242
}
242243

243244
/// Build the import queue for the template runtime (manual seal).
244-
pub fn build_manual_seal_import_queue<B, RA, HF>(
245-
client: Arc<FullClient<B, RA, HF>>,
245+
pub fn build_manual_seal_import_queue(
246+
client: Arc<Client>,
246247
config: &Configuration,
247248
_eth_config: &EthConfiguration,
248249
task_manager: &TaskManager,
249250
_telemetry: Option<TelemetryHandle>,
250-
_grandpa_block_import: GrandpaBlockImport<B, FullClient<B, RA, HF>>,
251-
) -> Result<(BasicQueue<B>, BoxBlockImport<B>), ServiceError>
252-
where
253-
B: BlockT,
254-
RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
255-
RA: Send + Sync + 'static,
256-
RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
257-
HF: HostFunctionsT + 'static,
251+
_grandpa_block_import: GrandpaBlockImport<Block, Client>,
252+
) -> Result<(BasicQueue<Block>, BoxBlockImport<Block>), ServiceError>
253+
// where
254+
// B: BlockT,
255+
// RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
256+
// RA: Send + Sync + 'static,
257+
// RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
258+
// HF: HostFunctionsT + 'static,
258259
{
259260
let frontier_block_import = FrontierBlockImport::new(client.clone(), client);
260261
Ok((
@@ -268,25 +269,25 @@ where
268269
}
269270

270271
/// Builds a new service for a full client.
271-
pub async fn new_full<B, RA, HF, NB>(
272+
pub async fn new_full<NB>(
272273
mut config: Configuration,
273274
eth_config: EthConfiguration,
274275
sealing: Option<Sealing>,
275276
) -> Result<TaskManager, ServiceError>
276277
where
277-
B: BlockT<Hash = H256>,
278-
NumberFor<B>: BlockNumberOps,
279-
<B as BlockT>::Header: Unpin,
280-
RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
281-
RA: Send + Sync + 'static,
282-
RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
283-
HF: HostFunctionsT + 'static,
284-
NB: sc_network::NetworkBackend<B, <B as sp_runtime::traits::Block>::Hash>,
278+
// B: BlockT<Hash = H256>,
279+
NumberFor<Block>: BlockNumberOps,
280+
// <B as BlockT>::Header: Unpin,
281+
// RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
282+
// RA: Send + Sync + 'static,
283+
// RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
284+
// HF: HostFunctionsT + 'static,
285+
NB: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>,
285286
{
286287
let build_import_queue = if sealing.is_some() {
287-
build_manual_seal_import_queue::<B, RA, HF>
288+
build_manual_seal_import_queue
288289
} else {
289-
build_aura_grandpa_import_queue::<B, RA, HF>
290+
build_aura_grandpa_import_queue
290291
};
291292

292293
let PartialComponents {
@@ -332,7 +333,7 @@ where
332333
None
333334
} else {
334335
net_config.add_notification_protocol(grandpa_protocol_config);
335-
let warp_sync: Arc<dyn WarpSyncProvider<B>> =
336+
let warp_sync: Arc<dyn WarpSyncProvider<Block>> =
336337
Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
337338
backend.clone(),
338339
grandpa_link.shared_authority_set().clone(),
@@ -378,10 +379,11 @@ where
378379

379380
let role = config.role;
380381
let force_authoring = config.force_authoring;
381-
let backoff_authoring_blocks = Some(BackoffAuthoringOnFinalizedHeadLagging::<NumberFor<B>> {
382-
unfinalized_slack: 6u32.into(),
383-
..Default::default()
384-
});
382+
let backoff_authoring_blocks =
383+
Some(BackoffAuthoringOnFinalizedHeadLagging::<NumberFor<Block>> {
384+
unfinalized_slack: 6u32.into(),
385+
..Default::default()
386+
});
385387
let name = config.network.node_name.clone();
386388
let frontier_backend = Arc::new(frontier_backend);
387389
let enable_grandpa = !config.disable_grandpa && sealing.is_none();
@@ -395,7 +397,7 @@ where
395397
// The MappingSyncWorker sends through the channel on block import and the subscription emits a notification to the subscriber on receiving a message through this channel.
396398
// This way we avoid race conditions when using native substrate block import notification stream.
397399
let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks<
398-
fc_mapping_sync::EthereumBlockNotification<B>,
400+
fc_mapping_sync::EthereumBlockNotification<Block>,
399401
> = Default::default();
400402
let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks);
401403

@@ -447,7 +449,7 @@ where
447449
client: client.clone(),
448450
pool: pool.clone(),
449451
graph: pool.pool().clone(),
450-
converter: Some(TransactionConverter::<B>::default()),
452+
converter: Some(TransactionConverter::<Block>::default()),
451453
is_authority,
452454
enable_dev_signer,
453455
network: network.clone(),
@@ -640,16 +642,10 @@ pub async fn build_full(
640642
) -> Result<TaskManager, ServiceError> {
641643
match config.network.network_backend {
642644
sc_network::config::NetworkBackendType::Libp2p => {
643-
new_full::<Block, RuntimeApi, HostFunctions, sc_network::NetworkWorker<_, _>>(
644-
config, eth_config, sealing,
645-
)
646-
.await
645+
new_full::<sc_network::NetworkWorker<_, _>>(config, eth_config, sealing).await
647646
}
648647
sc_network::config::NetworkBackendType::Litep2p => {
649-
new_full::<Block, RuntimeApi, HostFunctions, sc_network::Litep2pNetworkBackend>(
650-
config, eth_config, sealing,
651-
)
652-
.await
648+
new_full::<sc_network::NetworkWorker<_, _>>(config, eth_config, sealing).await
653649
}
654650
}
655651
}
@@ -675,35 +671,31 @@ pub fn new_chain_ops(
675671
task_manager,
676672
other,
677673
..
678-
} = new_partial::<Block, RuntimeApi, HostFunctions, _>(
679-
config,
680-
eth_config,
681-
build_aura_grandpa_import_queue,
682-
)?;
674+
} = new_partial(config, eth_config, build_aura_grandpa_import_queue)?;
683675
Ok((client, backend, import_queue, task_manager, other.3))
684676
}
685677

686678
#[allow(clippy::too_many_arguments)]
687-
fn run_manual_seal_authorship<B, RA, HF>(
679+
fn run_manual_seal_authorship(
688680
eth_config: &EthConfiguration,
689681
sealing: Sealing,
690-
client: Arc<FullClient<B, RA, HF>>,
691-
transaction_pool: Arc<FullPool<B, FullClient<B, RA, HF>>>,
692-
select_chain: FullSelectChain<B>,
693-
block_import: BoxBlockImport<B>,
682+
client: Arc<Client>,
683+
transaction_pool: Arc<FullPool<Block, Client>>,
684+
select_chain: FullSelectChain<Block>,
685+
block_import: BoxBlockImport<Block>,
694686
task_manager: &TaskManager,
695687
prometheus_registry: Option<&Registry>,
696688
telemetry: Option<&Telemetry>,
697689
commands_stream: mpsc::Receiver<
698-
sc_consensus_manual_seal::rpc::EngineCommand<<B as BlockT>::Hash>,
690+
sc_consensus_manual_seal::rpc::EngineCommand<<Block as BlockT>::Hash>,
699691
>,
700692
) -> Result<(), ServiceError>
701-
where
702-
B: BlockT,
703-
RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
704-
RA: Send + Sync + 'static,
705-
RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
706-
HF: HostFunctionsT + 'static,
693+
// where
694+
// B: BlockT,
695+
// RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
696+
// RA: Send + Sync + 'static,
697+
// RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
698+
// HF: HostFunctionsT + 'static,
707699
{
708700
let proposer_factory = sc_basic_authorship::ProposerFactory::new(
709701
task_manager.spawn_handle(),

0 commit comments

Comments
 (0)