Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update to almost latest substrate master #205

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1,688 changes: 860 additions & 828 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions network/src/tests/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl ProvideRuntimeApi for TestApi {
}

impl Core<Block> for RuntimeApi {
fn version_runtime_api_impl(
fn Core_version_runtime_api_impl(
&self,
_: &BlockId,
_: ExecutionContext,
Expand All @@ -188,7 +188,7 @@ impl Core<Block> for RuntimeApi {
unimplemented!("Not required for testing!")
}

fn authorities_runtime_api_impl(
fn Core_authorities_runtime_api_impl(
&self,
_: &BlockId,
_: ExecutionContext,
Expand All @@ -198,7 +198,7 @@ impl Core<Block> for RuntimeApi {
unimplemented!("Not required for testing!")
}

fn execute_block_runtime_api_impl(
fn Core_execute_block_runtime_api_impl(
&self,
_: &BlockId,
_: ExecutionContext,
Expand All @@ -208,7 +208,7 @@ impl Core<Block> for RuntimeApi {
unimplemented!("Not required for testing!")
}

fn initialize_block_runtime_api_impl(
fn Core_initialize_block_runtime_api_impl(
&self,
_: &BlockId,
_: ExecutionContext,
Expand All @@ -233,7 +233,7 @@ impl ApiExt<Block> for RuntimeApi {
}

impl ParachainHost<Block> for RuntimeApi {
fn validators_runtime_api_impl(
fn ParachainHost_validators_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand All @@ -243,7 +243,7 @@ impl ParachainHost<Block> for RuntimeApi {
Ok(NativeOrEncoded::Native(self.data.lock().validators.clone()))
}

fn duty_roster_runtime_api_impl(
fn ParachainHost_duty_roster_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand All @@ -256,7 +256,7 @@ impl ParachainHost<Block> for RuntimeApi {
}))
}

fn active_parachains_runtime_api_impl(
fn ParachainHost_active_parachains_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand All @@ -266,7 +266,7 @@ impl ParachainHost<Block> for RuntimeApi {
Ok(NativeOrEncoded::Native(self.data.lock().active_parachains.clone()))
}

fn parachain_head_runtime_api_impl(
fn ParachainHost_parachain_head_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand All @@ -276,7 +276,7 @@ impl ParachainHost<Block> for RuntimeApi {
Ok(NativeOrEncoded::Native(Some(Vec::new())))
}

fn parachain_code_runtime_api_impl(
fn ParachainHost_parachain_code_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand All @@ -286,7 +286,7 @@ impl ParachainHost<Block> for RuntimeApi {
Ok(NativeOrEncoded::Native(Some(Vec::new())))
}

fn ingress_runtime_api_impl(
fn ParachainHost_ingress_runtime_api_impl(
&self,
_at: &BlockId,
_: ExecutionContext,
Expand Down
4 changes: 3 additions & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ srml-system = { git = "https://github.com/paritytech/substrate", default-feature
srml-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
srml-treasury = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
substrate-consensus-authorities = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }

[dev-dependencies]
hex-literal = "0.1.0"
Expand Down Expand Up @@ -81,5 +82,6 @@ std = [
"serde_derive",
"serde/std",
"log",
"safe-mix/std"
"safe-mix/std",
"substrate-consensus-authorities/std"
]
13 changes: 12 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extern crate srml_sudo as sudo;
extern crate srml_system as system;
extern crate srml_timestamp as timestamp;
extern crate srml_treasury as treasury;
extern crate substrate_consensus_authorities as consensus_authorities;

extern crate polkadot_primitives as primitives;

Expand All @@ -88,7 +89,9 @@ use client::{
};
use sr_primitives::{
ApplyResult, generic, transaction_validity::TransactionValidity,
traits::{BlakeTwo256, Block as BlockT, DigestFor, StaticLookup}
traits::{
BlakeTwo256, Block as BlockT, DigestFor, StaticLookup, CurrencyToVoteHandler, AuthorityIdFor
}
};
use version::RuntimeVersion;
use grandpa::fg_primitives::{self, ScheduledChange};
Expand Down Expand Up @@ -187,6 +190,7 @@ impl session::Trait for Runtime {

impl staking::Trait for Runtime {
type OnRewardMinted = Treasury;
type CurrencyToVote = CurrencyToVoteHandler;
type Event = Event;
type Currency = balances::Module<Self>;
type Slash = ();
Expand Down Expand Up @@ -395,4 +399,11 @@ impl_runtime_apis! {
Aura::slot_duration()
}
}

impl consensus_authorities::AuthoritiesApi<Block> for Runtime {
fn authorities() -> Vec<AuthorityIdFor<Block>> {
Consensus::authorities()
}
}

}