Update to latest Substrate master (#320)

* Make `collator::Network` require `Send + Sync` to make it work

* Update packages

* Update to latest Substrate

* Make it compile and make tests work

* Use `polkadot-master`

* Fix CI

* Remove `build.sh` from readmes

* Delete old stuff

* Bring one back
This commit is contained in:
Bastian Köcher
2019-07-09 16:33:49 +02:00
committed by André Silva
parent d99f721540
commit c0b065837e
28 changed files with 728 additions and 4717 deletions
+20 -4
View File
@@ -37,11 +37,11 @@ use client::{
runtime_api as client_api, impl_runtime_apis,
};
use sr_primitives::{
ApplyResult, generic, transaction_validity::TransactionValidity, create_runtime_str,
ApplyResult, generic, transaction_validity::TransactionValidity, create_runtime_str, key_types,
traits::{BlakeTwo256, Block as BlockT, DigestFor, StaticLookup, Convert}, impl_opaque_keys
};
use version::RuntimeVersion;
use grandpa::fg_primitives::{self, ScheduledChange};
use grandpa::{AuthorityId as GrandpaId, fg_primitives::{self, ScheduledChange}};
use council::motions as council_motions;
#[cfg(feature = "std")]
use council::seats as council_seats;
@@ -63,6 +63,10 @@ pub use sr_primitives::{Permill, Perbill};
pub use timestamp::BlockPeriod;
pub use srml_support::StorageValue;
// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
/// Runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
@@ -182,7 +186,10 @@ parameter_types! {
type SessionHandlers = (Grandpa, Aura);
impl_opaque_keys! {
pub struct SessionKeys(grandpa::AuthorityId, AuraId);
pub struct SessionKeys {
#[id(key_types::ED25519)]
pub ed25519: GrandpaId,
}
}
// NOTE: `SessionHandler` and `SessionKeys` are co-dependent: One key will be used for each handler.
@@ -197,6 +204,14 @@ impl session::Trait for Runtime {
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
type Event = Event;
type Keys = SessionKeys;
type SelectInitialValidators = Staking;
type ValidatorId = AccountId;
type ValidatorIdOf = staking::StashOf<Self>;
}
impl session::historical::Trait for Runtime {
type FullIdentification = staking::Exposure<AccountId, Balance>;
type FullIdentificationOf = staking::ExposureOf<Self>;
}
/// Converter for currencies to votes.
@@ -228,6 +243,7 @@ impl staking::Trait for Runtime {
type Reward = ();
type SessionsPerEra = SessionsPerEra;
type BondingDuration = BondingDuration;
type SessionInterface = Self;
}
parameter_types! {
@@ -333,7 +349,7 @@ impl parachains::Trait for Runtime {
}
parameter_types!{
pub const LeasePeriod: BlockNumber = 100000;
pub const LeasePeriod: BlockNumber = 100_000;
pub const EndingPeriod: BlockNumber = 1000;
}
+9 -1
View File
@@ -865,6 +865,14 @@ mod tests {
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
type SessionHandler = ();
type Event = ();
type SelectInitialValidators = staking::Module<Self>;
type ValidatorId = crate::AccountId;
type ValidatorIdOf = staking::StashOf<Self>;
}
impl session::historical::Trait for Test {
type FullIdentification = staking::Exposure<crate::AccountId, Balance>;
type FullIdentificationOf = staking::ExposureOf<Self>;
}
impl timestamp::Trait for Test {
@@ -914,6 +922,7 @@ mod tests {
type Reward = ();
type SessionsPerEra = SessionsPerEra;
type BondingDuration = BondingDuration;
type SessionInterface = Self;
}
impl Trait for Test {
@@ -949,7 +958,6 @@ mod tests {
];
t.extend(session::GenesisConfig::<Test>{
validators: validator_keys.iter().map(|k| crate::AccountId::from(*k)).collect(),
keys: vec![],
}.build_storage().unwrap().0);
t.extend(GenesisConfig::<Test>{