Adds integration test based on adder collator (#1928)

* Adds integration test based on adder collator

This adds an integration test for parachains that uses the adder
collator. The test will start two relay chain nodes and one collator and
waits until 4 blocks are build and enacted by the parachain.

* Make sure the integration test is run in CI

* Fix wasm compilation

* Update parachain/test-parachains/adder/collator/src/lib.rs

Co-authored-by: Sergei Shulepov <sergei@parity.io>

* Update cli/src/command.rs

Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
Bastian Köcher
2020-11-09 11:26:29 +01:00
committed by GitHub
parent 80a2be8c4b
commit 83661eb8dc
24 changed files with 546 additions and 333 deletions
@@ -20,9 +20,9 @@ use sc_cli::{Result, Role, SubstrateCli};
use polkadot_cli::Cli;
use polkadot_node_subsystem::messages::{CollatorProtocolMessage, CollationGenerationMessage};
use polkadot_node_primitives::CollationGenerationConfig;
use polkadot_primitives::v1::{CollatorPair, Id as ParaId};
use polkadot_primitives::v1::Id as ParaId;
use test_parachain_adder_collator::Collator;
use sp_core::{Pair, hexdisplay::HexDisplay};
use sp_core::hexdisplay::HexDisplay;
use std::time::Duration;
const PARA_ID: ParaId = ParaId::new(100);
@@ -42,11 +42,11 @@ fn main() -> Result<()> {
match role {
Role::Light => Err("Light client not supported".into()),
_ => {
let collator_key = CollatorPair::generate().0;
let collator = Collator::new();
let full_node = polkadot_service::build_full(
config,
polkadot_service::IsCollator::Yes(collator_key.public()),
polkadot_service::IsCollator::Yes(collator.collator_id()),
None,
Some(sc_authority_discovery::WorkerConfig {
query_interval: Duration::from_secs(1),
@@ -57,7 +57,6 @@ fn main() -> Result<()> {
let mut overseer_handler = full_node.overseer_handler
.expect("Overseer handler should be initialized for collators");
let collator = Collator::new();
let genesis_head_hex = format!("0x{:?}", HexDisplay::from(&collator.genesis_head()));
let validation_code_hex = format!("0x{:?}", HexDisplay::from(&collator.validation_code()));
@@ -66,7 +65,7 @@ fn main() -> Result<()> {
log::info!("Validation code: {}", validation_code_hex);
let config = CollationGenerationConfig {
key: collator_key,
key: collator.collator_key(),
collator: collator.create_collation_function(),
para_id: PARA_ID,
};