Skip to content

Commit

Permalink
Chain spec fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Jul 14, 2019
1 parent 1db3ae7 commit 4e61b49
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 199 deletions.
55 changes: 2 additions & 53 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn testnet_genesis(
.collect::<Vec<_>>(),
}),
session: Some(SessionConfig {
keys: initial_authorities.iter().map(|x| (x.1.clone(), session_keys(x.2.clone()))).collect::<Vec<_>>(),
keys: initial_authorities.iter().map(|x| (x.0.clone(), session_keys(x.2.clone()))).collect::<Vec<_>>(),
}),
staking: Some(StakingConfig {
current_era: 0,
Expand All @@ -179,7 +179,7 @@ pub fn testnet_genesis(
offline_slash_grace: 4,
minimum_validator_count: 4,
stakers: initial_authorities.iter().map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator)).collect(),
invulnerables: initial_authorities.iter().map(|x| x.1.clone()).collect(),
invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
}),
democracy: Some(DemocracyConfig::default()),
collective_Instance1: Some(CouncilConfig {
Expand Down Expand Up @@ -269,54 +269,3 @@ pub fn local_testnet_config() -> ChainSpec {
None,
None)
}

#[cfg(test)]
pub(crate) mod tests {
use super::*;
use service_test;
use crate::Factory;

fn local_testnet_genesis_instant() -> GenesisConfig {
let mut genesis = local_testnet_genesis();
genesis.timestamp = Some(TimestampConfig { minimum_period: 1 });
genesis
}

fn local_testnet_genesis_instant_single() -> GenesisConfig {
let mut genesis = testnet_genesis(
vec![
get_authority_keys_from_seed("Alice"),
],
get_account_id_from_seed("Alice"),
None,
None,
);
genesis.timestamp = Some(TimestampConfig { minimum_period: 1 });
genesis
}

/// Local testnet config (single validator - Alice)
pub fn integration_test_config_with_single_authority() -> ChainSpec {
ChainSpec::from_genesis(
"Integration Test",
"test",
local_testnet_genesis_instant_single,
vec![],
None,
None,
None,
None,
)
}

/// Local testnet config (multivalidator Alice + Bob)
pub fn integration_test_config_with_two_authorities() -> ChainSpec {
ChainSpec::from_genesis("Integration Test", "test", local_testnet_genesis_instant, vec![], None, None, None, None)
}

#[test]
#[ignore]
fn test_connectivity() {
service_test::connectivity::<Factory>(integration_test_config_with_two_authorities());
}
}
40 changes: 20 additions & 20 deletions testnets/v0.4.0/chainspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@
"offlineSlash": 1000000,
"offlineSlashGrace": 4,
"invulnerables": [
"5EkGSct2SPojcFF6fX6EvF3xbaW5aq3oEW2ujJLjTKk8pexP",
"5C7rVE4qA7GvruqzHjc9RYnoNBP5hbCCKqpEjCm5KEmfvHir",
"5EHZY4syPYQ3bxs5MUahKsvWfYAHddWt3dim5MVFAnAonHxc",
"5DscYaYpUohKFeRJRvKYGU1XuDvLNo4XKuN6gDzeKSxF95eB",
"5E6xrSDyaARfbwkYQfDqsP2xA1wzLMoFRiXrpmWiuuV8GuZm",
"5GNyVHKVDEh4FfAQNhdkTWKuPT42j9ExsFJHfP7RjDo4s8qB",
"5HQsBQKSbxfEjWX76oerhbZQJQnaej9CKGx2rFpsWpYubTm3",
"5EWo159vVquevNxJU8h76y9a5URiXVvVSiYggcP5GCYF3dby",
"5HQwfPfmbuWt3fKyEK3SSuDneVtF4MwHbK1afsXPHxAfogyj",
"5E7hMvzKjcG31jjK7GhD5Xz9ZrKJSRGcct65tNDhccZkehMF"
"5DvWxEcMP66DgHigGm2eTTg4pPueDMMDS5F67ixK2WpCTKMU",
"5ECSwHL89ShGsfBt34HyjCHK7gkd6vGT5A4gTa5yd4mKPhYe",
"5HVcs12oqxzPBZg13DM2BRqnwVxfgTbyFSFzLmygDpjyfBKG",
"5EHvssibZkZHkZwoABzBqbb21rsaJjQg8KfW75TjVZmzbEh9",
"5CwKvDp9JTo3fLW9Q6NrEZ7PaCCjeLCmGbTnN2hEfs9WfRM7",
"5DRQpsFg1BgziDA5oMfwVyWzF8CkwwnxsguSu1utbgRNQFrK",
"5E5JcTyK2jJdwQkTx3dysADVxgYaH2YitKcSRXPHL42UFNQD",
"5GRgeaoDUAxYhb14xaYSoMN2G4S7MgoGucmjzHZBUCXS8XQf",
"5GH23iTUJtvz9KGDK36nXWHtrkm6E83ZZjVPFhb8DKQk3cv3",
"5G3h5wZrWiKwnYUbSCuM5EDzrSjyYWzjbocJYxH4Q83Q4VfD"
],
"currentEra": 0,
"currentSessionReward": 0,
Expand Down Expand Up @@ -255,61 +255,61 @@
"session": {
"keys": [
[
"5EkGSct2SPojcFF6fX6EvF3xbaW5aq3oEW2ujJLjTKk8pexP",
"5DvWxEcMP66DgHigGm2eTTg4pPueDMMDS5F67ixK2WpCTKMU",
{
"ed25519": "5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5"
}
],
[
"5C7rVE4qA7GvruqzHjc9RYnoNBP5hbCCKqpEjCm5KEmfvHir",
"5ECSwHL89ShGsfBt34HyjCHK7gkd6vGT5A4gTa5yd4mKPhYe",
{
"ed25519": "5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry"
}
],
[
"5EHZY4syPYQ3bxs5MUahKsvWfYAHddWt3dim5MVFAnAonHxc",
"5HVcs12oqxzPBZg13DM2BRqnwVxfgTbyFSFzLmygDpjyfBKG",
{
"ed25519": "5HWaNteWt4qUKVRY4bF6nbbX6BwJmpp2dgggXVnEPX8ksB4K"
}
],
[
"5DscYaYpUohKFeRJRvKYGU1XuDvLNo4XKuN6gDzeKSxF95eB",
"5EHvssibZkZHkZwoABzBqbb21rsaJjQg8KfW75TjVZmzbEh9",
{
"ed25519": "5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9"
}
],
[
"5E6xrSDyaARfbwkYQfDqsP2xA1wzLMoFRiXrpmWiuuV8GuZm",
"5CwKvDp9JTo3fLW9Q6NrEZ7PaCCjeLCmGbTnN2hEfs9WfRM7",
{
"ed25519": "5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq"
}
],
[
"5GNyVHKVDEh4FfAQNhdkTWKuPT42j9ExsFJHfP7RjDo4s8qB",
"5DRQpsFg1BgziDA5oMfwVyWzF8CkwwnxsguSu1utbgRNQFrK",
{
"ed25519": "5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5"
}
],
[
"5HQsBQKSbxfEjWX76oerhbZQJQnaej9CKGx2rFpsWpYubTm3",
"5E5JcTyK2jJdwQkTx3dysADVxgYaH2YitKcSRXPHL42UFNQD",
{
"ed25519": "5He2hStVecXboJfsQvJDgPTtWpExQBw9N4ER2FMSyeMqyzGn"
}
],
[
"5EWo159vVquevNxJU8h76y9a5URiXVvVSiYggcP5GCYF3dby",
"5GRgeaoDUAxYhb14xaYSoMN2G4S7MgoGucmjzHZBUCXS8XQf",
{
"ed25519": "5EBoJbE1WRvocBwGfYydXenBsJ8eKvUkxNduf6qWgx2bndvK"
}
],
[
"5HQwfPfmbuWt3fKyEK3SSuDneVtF4MwHbK1afsXPHxAfogyj",
"5GH23iTUJtvz9KGDK36nXWHtrkm6E83ZZjVPFhb8DKQk3cv3",
{
"ed25519": "5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1"
}
],
[
"5E7hMvzKjcG31jjK7GhD5Xz9ZrKJSRGcct65tNDhccZkehMF",
"5G3h5wZrWiKwnYUbSCuM5EDzrSjyYWzjbocJYxH4Q83Q4VfD",
{
"ed25519": "5G2yXYTi1JsgbvkRcnzMe6EABrBpi3g1w4QtWe1W4XHmJxpW"
}
Expand Down
Loading

0 comments on commit 4e61b49

Please sign in to comment.