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
@@ -28,10 +28,10 @@ pub mod currency {
pub mod time {
use primitives::v0::{Moment, BlockNumber};
// Testnet
pub const MILLISECS_PER_BLOCK: Moment = 1000;
pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
// Testnet
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
// 30 seconds for now
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = MINUTES / 2;
// These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
+12 -6
View File
@@ -25,8 +25,9 @@ use sp_std::prelude::*;
use sp_std::collections::btree_map::BTreeMap;
use codec::Encode;
use polkadot_runtime_parachains::{
configuration,
configuration as parachains_configuration,
inclusion,
inclusion_inherent,
initializer,
paras,
router,
@@ -42,7 +43,7 @@ use primitives::v1::{
use runtime_common::{
claims, SlowAdjustingFeeUpdate, paras_sudo_wrapper,
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, ParachainSessionKeyPlaceholder,
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
@@ -78,6 +79,7 @@ pub use sp_runtime::BuildStorage;
pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_balances::Call as BalancesCall;
pub use paras_sudo_wrapper::Call as ParasSudoWrapperCall;
pub use pallet_sudo::Call as SudoCall;
/// Constant values used within the runtime.
pub mod constants;
@@ -252,7 +254,8 @@ impl_opaque_keys! {
pub struct SessionKeys {
pub grandpa: Grandpa,
pub babe: Babe,
pub parachain_validator: ParachainSessionKeyPlaceholder<Runtime>,
pub parachain_validator: Initializer,
pub authority_discovery: AuthorityDiscovery,
}
}
@@ -440,12 +443,14 @@ impl pallet_sudo::Trait for Runtime {
type Call = Call;
}
impl configuration::Trait for Runtime {}
impl parachains_configuration::Trait for Runtime {}
impl inclusion::Trait for Runtime {
type Event = Event;
}
impl inclusion_inherent::Trait for Runtime {}
impl initializer::Trait for Runtime {
type Randomness = RandomnessCollectiveFlip;
}
@@ -497,8 +502,9 @@ construct_runtime! {
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
// Parachains runtime modules
Configuration: configuration::{Module, Call, Storage},
ParachainsConfiguration: parachains_configuration::{Module, Call, Storage, Config<T>},
Inclusion: inclusion::{Module, Call, Storage, Event<T>},
InclusionInherent: inclusion_inherent::{Module, Call, Storage, Inherent},
Initializer: initializer::{Module, Call, Storage},
Paras: paras::{Module, Call, Storage, Origin},
Scheduler: scheduler::{Module, Call, Storage},
@@ -603,7 +609,7 @@ sp_api::impl_runtime_apis! {
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
fn authorities() -> Vec<AuthorityDiscoveryId> {
Vec::new()
AuthorityDiscovery::authorities()
}
}