Update to latest substrate master (#284)

* Update substrate deps and fix runtime compilation

* Fix compilation

* Enable `std` feature
This commit is contained in:
Bastian Köcher
2019-06-06 15:15:25 +02:00
committed by Gavin Wood
parent bdc1502411
commit 6473feb687
7 changed files with 1739 additions and 1526 deletions
+1022 -976
View File
File diff suppressed because it is too large Load Diff
-10
View File
@@ -206,16 +206,6 @@ impl Core<Block> for RuntimeApi {
unimplemented!("Not required for testing!")
}
fn Core_authorities_runtime_api_impl(
&self,
_: &BlockId,
_: ExecutionContext,
_: Option<()>,
_: Vec<u8>,
) -> ClientResult<NativeOrEncoded<Vec<SessionKey>>> {
unimplemented!("Not required for testing!")
}
fn Core_execute_block_runtime_api_impl(
&self,
_: &BlockId,
+8 -5
View File
@@ -26,7 +26,10 @@ use substrate_network::consensus_gossip::{
};
use polkadot_validation::{Network as ParachainNetwork, SharedTable, Collators, Statement, GenericStatement};
use polkadot_primitives::{Block, BlockId, Hash, SessionKey};
use polkadot_primitives::parachain::{Id as ParaId, Collation, Extrinsic, ParachainHost, CandidateReceipt, CollatorId, ValidatorId, PoVBlock, ValidatorIndex};
use polkadot_primitives::parachain::{
Id as ParaId, Collation, Extrinsic, ParachainHost, CandidateReceipt, CollatorId,
ValidatorId, PoVBlock, ValidatorIndex,
};
use futures::prelude::*;
use futures::future::{self, Executor as FutureExecutor};
@@ -58,7 +61,7 @@ pub trait Executor {
pub struct WrappedExecutor<T>(pub T);
impl<T> Executor for WrappedExecutor<T>
where T: FutureExecutor<Box<Future<Item=(),Error=()> + Send + 'static>>
where T: FutureExecutor<Box<dyn Future<Item=(),Error=()> + Send + 'static>>
{
fn spawn<F: Future<Item=(),Error=()> + Send + 'static>(&self, f: F) {
if let Err(e) = self.0.execute(Box::new(f)) {
@@ -94,11 +97,11 @@ pub trait NetworkService: Send + Sync + 'static {
/// Execute a closure with the gossip service.
fn with_gossip<F: Send + 'static>(&self, with: F)
where F: FnOnce(&mut GossipService, &mut NetContext<Block>);
where F: FnOnce(&mut dyn GossipService, &mut dyn NetContext<Block>);
/// Execute a closure with the polkadot protocol.
fn with_spec<F: Send + 'static>(&self, with: F)
where F: FnOnce(&mut PolkadotProtocol, &mut NetContext<Block>);
where F: FnOnce(&mut PolkadotProtocol, &mut dyn NetContext<Block>);
}
impl NetworkService for super::NetworkService {
@@ -126,7 +129,7 @@ impl NetworkService for super::NetworkService {
}
fn with_gossip<F: Send + 'static>(&self, with: F)
where F: FnOnce(&mut GossipService, &mut NetContext<Block>)
where F: FnOnce(&mut dyn GossipService, &mut dyn NetContext<Block>)
{
super::NetworkService::with_gossip(self, move |gossip, ctx| with(gossip, ctx))
}
+3 -1
View File
@@ -81,5 +81,7 @@ std = [
"serde/std",
"log",
"safe-mix/std",
"consensus_authorities/std"
"consensus_authorities/std",
"consensus_aura/std",
"aura/std",
]
+14 -4
View File
@@ -163,10 +163,24 @@ impl staking::Trait for Runtime {
type Reward = ();
}
const MINUTES: BlockNumber = 6;
const BUCKS: Balance = 1_000_000_000_000;
parameter_types! {
pub const LaunchPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const VotingPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const MinimumDeposit: Balance = 100 * BUCKS;
pub const EnactmentPeriod: BlockNumber = 30 * 24 * 60 * MINUTES;
}
impl democracy::Trait for Runtime {
type Currency = balances::Module<Self>;
type Proposal = Call;
type Event = Event;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type MinimumDeposit = MinimumDeposit;
}
impl council::Trait for Runtime {
@@ -277,10 +291,6 @@ impl_runtime_apis! {
VERSION
}
fn authorities() -> Vec<SessionKey> {
Consensus::authorities()
}
fn execute_block(block: Block) {
Executive::execute_block(block)
}
+690 -516
View File
File diff suppressed because it is too large Load Diff
+2 -14
View File
@@ -117,13 +117,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
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(),
}),
democracy: Some(DemocracyConfig {
launch_period: 10 * MINUTES, // 1 day per public referendum
voting_period: 10 * MINUTES, // 3 days to discuss & vote on an active referendum
minimum_deposit: 50 * DOLLARS, // 12000 as the minimum deposit for a referendum
public_delay: 10 * MINUTES,
max_lock_periods: 6,
}),
democracy: Some(Default::default()),
council_seats: Some(CouncilSeatsConfig {
active_council: vec![],
candidacy_bond: 10 * DOLLARS,
@@ -262,13 +256,7 @@ pub fn testnet_genesis(
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(),
}),
democracy: Some(DemocracyConfig {
launch_period: 9,
voting_period: 18,
minimum_deposit: 10,
public_delay: 0,
max_lock_periods: 6,
}),
democracy: Some(DemocracyConfig::default()),
council_seats: Some(CouncilSeatsConfig {
active_council: endowed_accounts.iter()
.filter(|&endowed| initial_authorities.iter().find(|&(_, controller, _)| controller == endowed).is_none())