@@ -46,7 +46,7 @@ use cumulus_relay_chain_interface::RelayChainInterface;
4646
4747use polkadot_node_primitives:: { CollationResult , MaybeCompressedPoV } ;
4848use polkadot_overseer:: Handle as OverseerHandle ;
49- use polkadot_primitives:: { Block as PBlock , CollatorPair , Header as PHeader , Id as ParaId } ;
49+ use polkadot_primitives:: { Block as PBlock , CollatorPair , Header as PHeader , Id as ParaId , OccupiedCoreAssumption } ;
5050
5151use futures:: prelude:: * ;
5252use sc_client_api:: { backend:: AuxStore , BlockBackend , BlockOf } ;
@@ -73,7 +73,7 @@ use sp_state_machine::StorageChanges;
7373use sp_timestamp:: Timestamp ;
7474use std:: { convert:: TryFrom , error:: Error , fmt:: Debug , hash:: Hash , sync:: Arc , time:: Duration } ;
7575
76- use crate :: collator as collator_util;
76+ use crate :: collator:: { self as collator_util, SlotClaim } ;
7777
7878/// Parameters for [`run`].
7979pub struct Params < BI , CIDP , Client , Backend , RClient , SO , Proposer , CS > {
@@ -186,7 +186,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
186186
187187 let potential_parents = cumulus_client_consensus_common:: find_potential_parents :: < Block > (
188188 parent_search_params,
189- & params. para_backend ,
189+ & * params. para_backend ,
190190 & params. relay_client ,
191191 )
192192 . await ;
@@ -212,20 +212,20 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
212212
213213 let para_client = & * params. para_client ;
214214 let keystore = & params. keystore ;
215- let can_build_upon = |block_hash| can_build_upon (
215+ let can_build_upon = |block_hash| can_build_upon :: < _ , _ , P > (
216216 slot_now,
217217 timestamp,
218218 block_hash,
219219 included_block,
220- & para_client,
220+ para_client,
221221 & keystore,
222222 ) ;
223223
224224 // Sort by depth, ascending, to choose the longest chain.
225225 //
226226 // If the longest chain has space, build upon that. Otherwise, don't
227227 // build at all.
228- potential_parents. sort_by_key ( |a| & a. depth ) ;
228+ potential_parents. sort_by_key ( |a| a. depth ) ;
229229 let initial_parent = match potential_parents. pop ( ) {
230230 None => continue ,
231231 Some ( p) => p,
@@ -241,8 +241,8 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
241241 Some ( c) => c,
242242 } ;
243243
244- let persisted_validation_data = PersistedValidationData {
245- parent_head : parent_header. encode ( ) ,
244+ let validation_data = PersistedValidationData {
245+ parent_head : parent_header. encode ( ) . into ( ) ,
246246 relay_parent_number : * relay_parent_header. number ( ) ,
247247 relay_parent_storage_root : * relay_parent_header. state_root ( ) ,
248248 max_pov_size,
@@ -252,7 +252,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
252252 // `can_build_upon` fails or building a collation fails.
253253 let ( parachain_inherent_data, other_inherent_data) = match collator. create_inherent_data (
254254 relay_parent,
255- & persisted_validation_data ,
255+ & validation_data ,
256256 parent_hash,
257257 slot_claim. timestamp ( ) ,
258258 ) . await {
@@ -263,7 +263,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
263263 Ok ( x) => x,
264264 } ;
265265
266- let ( new_block_hash , new_block_header ) = match collator. collate (
266+ match collator. collate (
267267 & parent_header,
268268 & slot_claim,
269269 None ,
@@ -277,7 +277,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
277277 ) . await {
278278 Ok ( ( collation, block_data, new_block_hash) ) => {
279279 parent_hash = new_block_hash;
280- parent_header = block_data. header ;
280+ parent_header = block_data. into_header ( ) ;
281281
282282 // TODO [now]: announce to parachain sub-network
283283
@@ -288,7 +288,7 @@ pub async fn run<Block, P, BI, CIDP, Client, Backend, RClient, SO, Proposer, CS>
288288 tracing:: error!( target: crate :: LOG_TARGET , ?err) ;
289289 break ;
290290 }
291- } ;
291+ }
292292 }
293293 }
294294}
@@ -315,7 +315,7 @@ where
315315
316316 // TODO [now]: new runtime API,
317317 // AuraUnincludedSegmentApi::has_space(included_block, slot) or something like it.
318- unimplemented ! ( )
318+ unimplemented ! ( ) ;
319319
320- Some ( SlotClaim :: unchecked ( author_pub, slot, timestamp) )
320+ Some ( SlotClaim :: unchecked :: < P > ( author_pub, slot, timestamp) )
321321}
0 commit comments