mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Cleanups (#1933)
* Introduce CollatorFn type alias * Make test-runtime imports consistent with rococo-runtime * Update node/primitives/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * fix warnings Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -16,12 +16,11 @@
|
||||
|
||||
//! Collator for the adder test parachain.
|
||||
|
||||
use std::{pin::Pin, sync::{Arc, Mutex}, collections::HashMap, time::Duration};
|
||||
use std::{sync::{Arc, Mutex}, collections::HashMap, time::Duration};
|
||||
use test_parachain_adder::{hash_state, BlockData, HeadData, execute};
|
||||
use futures::{Future, FutureExt};
|
||||
use futures_timer::Delay;
|
||||
use polkadot_primitives::v1::{ValidationData, PoV, Hash, CollatorId, CollatorPair};
|
||||
use polkadot_node_primitives::Collation;
|
||||
use polkadot_primitives::v1::{PoV, CollatorId, CollatorPair};
|
||||
use polkadot_node_primitives::{Collation, CollatorFn};
|
||||
use codec::{Encode, Decode};
|
||||
use sp_core::Pair;
|
||||
|
||||
@@ -116,7 +115,9 @@ impl Collator {
|
||||
/// This collation function can be plugged into the overseer to generate collations for the adder parachain.
|
||||
pub fn create_collation_function(
|
||||
&self,
|
||||
) -> Box<dyn Fn(Hash, &ValidationData) -> Pin<Box<dyn Future<Output = Option<Collation>> + Send>> + Send + Sync> {
|
||||
) -> CollatorFn {
|
||||
use futures::FutureExt as _;
|
||||
|
||||
let state = self.state.clone();
|
||||
|
||||
Box::new(move |relay_parent, validation_data| {
|
||||
@@ -166,7 +167,7 @@ mod tests {
|
||||
|
||||
use futures::executor::block_on;
|
||||
use polkadot_parachain::{primitives::ValidationParams, wasm_executor::ExecutionMode};
|
||||
use polkadot_primitives::v1::PersistedValidationData;
|
||||
use polkadot_primitives::v1::{ValidationData, PersistedValidationData};
|
||||
use codec::Decode;
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user