Integration tests (#805)

* Started substrate tests

* Sync test

* Test updates

* Improved tests

* Use on-chain block delay

* Parallel test execution

* Otimized tests

* Logging

* Fixed racing test

* Fixed compilation

* Fixed timestamp test

* Removed rlp dependency

* Minor fixes

* Fixed tests

* Removed best_block_id and resolved fdlimit issue

* Whitespace

* Use keyring

* Style

* Added API execution setting

* Removed stale import
This commit is contained in:
Arkadiy Paronyan
2018-09-28 11:37:55 +02:00
committed by Gav Wood
parent 955a5393d8
commit 9a660f82ed
30 changed files with 590 additions and 140 deletions
+20 -1
View File
@@ -30,6 +30,16 @@ enum GenesisSource<G> {
Factory(fn() -> G),
}
impl<G: RuntimeGenesis> Clone for GenesisSource<G> {
fn clone(&self) -> Self {
match *self {
GenesisSource::File(ref path) => GenesisSource::File(path.clone()),
GenesisSource::Embedded(d) => GenesisSource::Embedded(d),
GenesisSource::Factory(f) => GenesisSource::Factory(f),
}
}
}
impl<G: RuntimeGenesis> GenesisSource<G> {
fn resolve(&self) -> Result<Genesis<G>, String> {
#[derive(Serialize, Deserialize)]
@@ -69,7 +79,7 @@ enum Genesis<G> {
Raw(HashMap<StorageKey, StorageData>),
}
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
struct ChainSpecFile {
pub name: String,
@@ -85,6 +95,15 @@ pub struct ChainSpec<G: RuntimeGenesis> {
genesis: GenesisSource<G>,
}
impl<G: RuntimeGenesis> Clone for ChainSpec<G> {
fn clone(&self) -> Self {
ChainSpec {
spec: self.spec.clone(),
genesis: self.genesis.clone(),
}
}
}
impl<G: RuntimeGenesis> ChainSpec<G> {
pub fn boot_nodes(&self) -> &[String] {
&self.spec.boot_nodes