Commit cf7b4564 authored by Bastian Köcher's avatar Bastian Köcher Committed by asynchronous rob
Browse files

Update to latest Substrate master + warning fixes (#292)



* Update to latest Substrate master + warning fixes

* Update runtime/src/lib.rs
Co-Authored-By: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>
parent 4924efe4
Pipeline #40910 passed with stages
in 23 minutes and 29 seconds
This diff is collapsed.
...@@ -10,8 +10,8 @@ futures = "0.1.17" ...@@ -10,8 +10,8 @@ futures = "0.1.17"
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
parity-codec = "3.0" parity-codec = "3.0"
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_authorities = { package = "substrate-consensus-authorities", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
aura = { package = "substrate-consensus-aura", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-runtime = { path = "../runtime", version = "0.1" } polkadot-runtime = { path = "../runtime", version = "0.1" }
polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" }
polkadot-cli = { path = "../cli" } polkadot-cli = { path = "../cli" }
......
...@@ -63,8 +63,8 @@ use polkadot_cli::{Worker, IntoExit, ProvideRuntimeApi, TaskExecutor}; ...@@ -63,8 +63,8 @@ use polkadot_cli::{Worker, IntoExit, ProvideRuntimeApi, TaskExecutor};
use polkadot_network::validation::{ValidationNetwork, SessionParams}; use polkadot_network::validation::{ValidationNetwork, SessionParams};
use polkadot_network::NetworkService; use polkadot_network::NetworkService;
use tokio::timer::Timeout; use tokio::timer::Timeout;
use consensus_authorities::AuthoritiesApi;
use consensus_common::SelectChain; use consensus_common::SelectChain;
use aura::AuraApi;
pub use polkadot_cli::VersionInfo; pub use polkadot_cli::VersionInfo;
pub use polkadot_network::validation::Incoming; pub use polkadot_network::validation::Incoming;
...@@ -189,7 +189,7 @@ impl<P: 'static, E: 'static> RelayChainContext for ApiContext<P, E> where ...@@ -189,7 +189,7 @@ impl<P: 'static, E: 'static> RelayChainContext for ApiContext<P, E> where
E: Future<Item=(),Error=()> + Clone + Send + Sync + 'static, E: Future<Item=(),Error=()> + Clone + Send + Sync + 'static,
{ {
type Error = String; type Error = String;
type FutureEgress = Box<Future<Item=ConsolidatedIngress, Error=String> + Send>; type FutureEgress = Box<dyn Future<Item=ConsolidatedIngress, Error=String> + Send>;
fn unrouted_egress(&self, _id: ParaId) -> Self::FutureEgress { fn unrouted_egress(&self, _id: ParaId) -> Self::FutureEgress {
// TODO: https://github.com/paritytech/polkadot/issues/253 // TODO: https://github.com/paritytech/polkadot/issues/253
...@@ -227,7 +227,7 @@ impl<P, E> Worker for CollationNode<P, E> where ...@@ -227,7 +227,7 @@ impl<P, E> Worker for CollationNode<P, E> where
E: Future<Item=(),Error=()> + Clone + Send + Sync + 'static, E: Future<Item=(),Error=()> + Clone + Send + Sync + 'static,
<P::ProduceCandidate as IntoFuture>::Future: Send + 'static, <P::ProduceCandidate as IntoFuture>::Future: Send + 'static,
{ {
type Work = Box<Future<Item=(),Error=()> + Send>; type Work = Box<dyn Future<Item=(),Error=()> + Send>;
fn configuration(&self) -> CustomConfiguration { fn configuration(&self) -> CustomConfiguration {
let mut config = CustomConfiguration::default(); let mut config = CustomConfiguration::default();
...@@ -409,7 +409,7 @@ mod tests { ...@@ -409,7 +409,7 @@ mod tests {
impl RelayChainContext for DummyRelayChainContext { impl RelayChainContext for DummyRelayChainContext {
type Error = (); type Error = ();
type FutureEgress = Box<Future<Item=ConsolidatedIngress,Error=()>>; type FutureEgress = Box<dyn Future<Item=ConsolidatedIngress,Error=()>>;
fn unrouted_egress(&self, para_id: ParaId) -> Self::FutureEgress { fn unrouted_egress(&self, para_id: ParaId) -> Self::FutureEgress {
match self.ingress.get(&para_id) { match self.ingress.get(&para_id) {
......
...@@ -158,14 +158,14 @@ pub fn register_validator<O: KnownOracle + 'static>( ...@@ -158,14 +158,14 @@ pub fn register_validator<O: KnownOracle + 'static>(
/// Create this using `register_validator`. /// Create this using `register_validator`.
#[derive(Clone)] #[derive(Clone)]
pub struct RegisteredMessageValidator { pub struct RegisteredMessageValidator {
inner: Arc<MessageValidator<KnownOracle>>, inner: Arc<MessageValidator<dyn KnownOracle>>,
} }
impl RegisteredMessageValidator { impl RegisteredMessageValidator {
#[cfg(test)] #[cfg(test)]
pub(crate) fn new_test<O: KnownOracle + 'static>( pub(crate) fn new_test<O: KnownOracle + 'static>(
oracle: O, oracle: O,
report_handle: Box<Fn(&PeerId, i32) + Send + Sync>, report_handle: Box<dyn Fn(&PeerId, i32) + Send + Sync>,
) -> Self { ) -> Self {
let validator = Arc::new(MessageValidator::new_test(oracle, report_handle)); let validator = Arc::new(MessageValidator::new_test(oracle, report_handle));
...@@ -423,7 +423,7 @@ impl<O: ?Sized + KnownOracle> Inner<O> { ...@@ -423,7 +423,7 @@ impl<O: ?Sized + KnownOracle> Inner<O> {
/// An unregistered message validator. Register this with `register_validator`. /// An unregistered message validator. Register this with `register_validator`.
pub struct MessageValidator<O: ?Sized> { pub struct MessageValidator<O: ?Sized> {
report_handle: Box<Fn(&PeerId, i32) + Send + Sync>, report_handle: Box<dyn Fn(&PeerId, i32) + Send + Sync>,
inner: RwLock<Inner<O>>, inner: RwLock<Inner<O>>,
} }
...@@ -431,7 +431,7 @@ impl<O: KnownOracle + ?Sized> MessageValidator<O> { ...@@ -431,7 +431,7 @@ impl<O: KnownOracle + ?Sized> MessageValidator<O> {
#[cfg(test)] #[cfg(test)]
fn new_test( fn new_test(
oracle: O, oracle: O,
report_handle: Box<Fn(&PeerId, i32) + Send + Sync>, report_handle: Box<dyn Fn(&PeerId, i32) + Send + Sync>,
) -> Self where O: Sized{ ) -> Self where O: Sized{
MessageValidator { MessageValidator {
report_handle, report_handle,
...@@ -449,19 +449,19 @@ impl<O: KnownOracle + ?Sized> MessageValidator<O> { ...@@ -449,19 +449,19 @@ impl<O: KnownOracle + ?Sized> MessageValidator<O> {
} }
impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValidator<O> { impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValidator<O> {
fn new_peer(&self, _context: &mut ValidatorContext<Block>, who: &PeerId, _roles: Roles) { fn new_peer(&self, _context: &mut dyn ValidatorContext<Block>, who: &PeerId, _roles: Roles) {
let mut inner = self.inner.write(); let mut inner = self.inner.write();
inner.peers.insert(who.clone(), PeerData { inner.peers.insert(who.clone(), PeerData {
live: HashMap::new(), live: HashMap::new(),
}); });
} }
fn peer_disconnected(&self, _context: &mut ValidatorContext<Block>, who: &PeerId) { fn peer_disconnected(&self, _context: &mut dyn ValidatorContext<Block>, who: &PeerId) {
let mut inner = self.inner.write(); let mut inner = self.inner.write();
inner.peers.remove(who); inner.peers.remove(who);
} }
fn validate(&self, context: &mut ValidatorContext<Block>, sender: &PeerId, mut data: &[u8]) fn validate(&self, context: &mut dyn ValidatorContext<Block>, sender: &PeerId, mut data: &[u8])
-> GossipValidationResult<Hash> -> GossipValidationResult<Hash>
{ {
let (res, cost_benefit) = match GossipMessage::decode(&mut data) { let (res, cost_benefit) = match GossipMessage::decode(&mut data) {
...@@ -486,7 +486,7 @@ impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValida ...@@ -486,7 +486,7 @@ impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValida
res res
} }
fn message_expired<'a>(&'a self) -> Box<FnMut(Hash, &[u8]) -> bool + 'a> { fn message_expired<'a>(&'a self) -> Box<dyn FnMut(Hash, &[u8]) -> bool + 'a> {
let inner = self.inner.read(); let inner = self.inner.read();
Box::new(move |topic, _data| { Box::new(move |topic, _data| {
...@@ -495,7 +495,7 @@ impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValida ...@@ -495,7 +495,7 @@ impl<O: KnownOracle + ?Sized> network_gossip::Validator<Block> for MessageValida
}) })
} }
fn message_allowed<'a>(&'a self) -> Box<FnMut(&PeerId, MessageIntent, &Hash, &[u8]) -> bool + 'a> { fn message_allowed<'a>(&'a self) -> Box<dyn FnMut(&PeerId, MessageIntent, &Hash, &[u8]) -> bool + 'a> {
let mut inner = self.inner.write(); let mut inner = self.inner.write();
Box::new(move |who, intent, topic, data| { Box::new(move |who, intent, topic, data| {
let &mut Inner { ref mut peers, ref mut our_view, .. } = &mut *inner; let &mut Inner { ref mut peers, ref mut our_view, .. } = &mut *inner;
......
...@@ -175,7 +175,7 @@ pub enum Message { ...@@ -175,7 +175,7 @@ pub enum Message {
Collation(Hash, Collation), Collation(Hash, Collation),
} }
fn send_polkadot_message(ctx: &mut Context<Block>, to: PeerId, message: Message) { fn send_polkadot_message(ctx: &mut dyn Context<Block>, to: PeerId, message: Message) {
trace!(target: "p_net", "Sending polkadot message to {}: {:?}", to, message); trace!(target: "p_net", "Sending polkadot message to {}: {:?}", to, message);
let encoded = message.encode(); let encoded = message.encode();
ctx.send_chain_specific(to, encoded) ctx.send_chain_specific(to, encoded)
...@@ -215,7 +215,7 @@ impl PolkadotProtocol { ...@@ -215,7 +215,7 @@ impl PolkadotProtocol {
/// Fetch block data by candidate receipt. /// Fetch block data by candidate receipt.
fn fetch_pov_block( fn fetch_pov_block(
&mut self, &mut self,
ctx: &mut Context<Block>, ctx: &mut dyn Context<Block>,
candidate: &CandidateReceipt, candidate: &CandidateReceipt,
relay_parent: Hash, relay_parent: Hash,
canon_roots: StructuredUnroutedIngress, canon_roots: StructuredUnroutedIngress,
...@@ -238,7 +238,7 @@ impl PolkadotProtocol { ...@@ -238,7 +238,7 @@ impl PolkadotProtocol {
/// Note new validation session. /// Note new validation session.
fn new_validation_session( fn new_validation_session(
&mut self, &mut self,
ctx: &mut Context<Block>, ctx: &mut dyn Context<Block>,
params: validation::SessionParams, params: validation::SessionParams,
) -> validation::ValidationSession { ) -> validation::ValidationSession {
...@@ -265,7 +265,7 @@ impl PolkadotProtocol { ...@@ -265,7 +265,7 @@ impl PolkadotProtocol {
self.live_validation_sessions.remove(parent_hash) self.live_validation_sessions.remove(parent_hash)
} }
fn dispatch_pending_requests(&mut self, ctx: &mut Context<Block>) { fn dispatch_pending_requests(&mut self, ctx: &mut dyn Context<Block>) {
let mut new_pending = Vec::new(); let mut new_pending = Vec::new();
let validator_keys = &mut self.validators; let validator_keys = &mut self.validators;
let next_req_id = &mut self.next_req_id; let next_req_id = &mut self.next_req_id;
...@@ -316,7 +316,7 @@ impl PolkadotProtocol { ...@@ -316,7 +316,7 @@ impl PolkadotProtocol {
self.pending = new_pending; self.pending = new_pending;
} }
fn on_polkadot_message(&mut self, ctx: &mut Context<Block>, who: PeerId, msg: Message) { fn on_polkadot_message(&mut self, ctx: &mut dyn Context<Block>, who: PeerId, msg: Message) {
trace!(target: "p_net", "Polkadot message from {}: {:?}", who, msg); trace!(target: "p_net", "Polkadot message from {}: {:?}", who, msg);
match msg { match msg {
Message::SessionKey(key) => self.on_session_key(ctx, who, key), Message::SessionKey(key) => self.on_session_key(ctx, who, key),
...@@ -352,7 +352,7 @@ impl PolkadotProtocol { ...@@ -352,7 +352,7 @@ impl PolkadotProtocol {
} }
} }
fn on_session_key(&mut self, ctx: &mut Context<Block>, who: PeerId, key: SessionKey) { fn on_session_key(&mut self, ctx: &mut dyn Context<Block>, who: PeerId, key: SessionKey) {
{ {
let info = match self.peers.get_mut(&who) { let info = match self.peers.get_mut(&who) {
Some(peer) => peer, Some(peer) => peer,
...@@ -396,7 +396,7 @@ impl PolkadotProtocol { ...@@ -396,7 +396,7 @@ impl PolkadotProtocol {
fn on_pov_block( fn on_pov_block(
&mut self, &mut self,
ctx: &mut Context<Block>, ctx: &mut dyn Context<Block>,
who: PeerId, who: PeerId,
req_id: RequestId, req_id: RequestId,
pov_block: Option<PoVBlock>, pov_block: Option<PoVBlock>,
...@@ -429,7 +429,7 @@ impl PolkadotProtocol { ...@@ -429,7 +429,7 @@ impl PolkadotProtocol {
} }
// when a validator sends us (a collator) a new role. // when a validator sends us (a collator) a new role.
fn on_new_role(&mut self, ctx: &mut Context<Block>, who: PeerId, role: Role) { fn on_new_role(&mut self, ctx: &mut dyn Context<Block>, who: PeerId, role: Role) {
let info = match self.peers.get_mut(&who) { let info = match self.peers.get_mut(&who) {
Some(peer) => peer, Some(peer) => peer,
None => { None => {
...@@ -467,7 +467,7 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -467,7 +467,7 @@ impl Specialization<Block> for PolkadotProtocol {
Status { collating_for: self.collating_for.clone() }.encode() Status { collating_for: self.collating_for.clone() }.encode()
} }
fn on_connect(&mut self, ctx: &mut Context<Block>, who: PeerId, status: FullStatus) { fn on_connect(&mut self, ctx: &mut dyn Context<Block>, who: PeerId, status: FullStatus) {
let local_status = match Status::decode(&mut &status.chain_status[..]) { let local_status = match Status::decode(&mut &status.chain_status[..]) {
Some(status) => status, Some(status) => status,
None => { None => {
...@@ -515,7 +515,7 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -515,7 +515,7 @@ impl Specialization<Block> for PolkadotProtocol {
self.dispatch_pending_requests(ctx); self.dispatch_pending_requests(ctx);
} }
fn on_disconnect(&mut self, ctx: &mut Context<Block>, who: PeerId) { fn on_disconnect(&mut self, ctx: &mut dyn Context<Block>, who: PeerId) {
if let Some(info) = self.peers.remove(&who) { if let Some(info) = self.peers.remove(&who) {
if let Some((acc_id, _)) = info.collating_for { if let Some((acc_id, _)) = info.collating_for {
let new_primary = self.collators.on_disconnect(acc_id) let new_primary = self.collators.on_disconnect(acc_id)
...@@ -559,7 +559,12 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -559,7 +559,12 @@ impl Specialization<Block> for PolkadotProtocol {
} }
} }
fn on_message(&mut self, ctx: &mut Context<Block>, who: PeerId, message: &mut Option<message::Message<Block>>) { fn on_message(
&mut self,
ctx: &mut dyn Context<Block>,
who: PeerId,
message: &mut Option<message::Message<Block>>
) {
match message.take() { match message.take() {
Some(generic_message::Message::ChainSpecific(raw)) => { Some(generic_message::Message::ChainSpecific(raw)) => {
match Message::decode(&mut raw.as_slice()) { match Message::decode(&mut raw.as_slice()) {
...@@ -581,7 +586,7 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -581,7 +586,7 @@ impl Specialization<Block> for PolkadotProtocol {
fn on_abort(&mut self) { } fn on_abort(&mut self) { }
fn maintain_peers(&mut self, ctx: &mut Context<Block>) { fn maintain_peers(&mut self, ctx: &mut dyn Context<Block>) {
self.collators.collect_garbage(None); self.collators.collect_garbage(None);
self.local_collations.collect_garbage(None); self.local_collations.collect_garbage(None);
self.dispatch_pending_requests(ctx); self.dispatch_pending_requests(ctx);
...@@ -600,7 +605,7 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -600,7 +605,7 @@ impl Specialization<Block> for PolkadotProtocol {
} }
} }
fn on_block_imported(&mut self, _ctx: &mut Context<Block>, hash: Hash, header: &Header) { fn on_block_imported(&mut self, _ctx: &mut dyn Context<Block>, hash: Hash, header: &Header) {
self.collators.collect_garbage(Some(&hash)); self.collators.collect_garbage(Some(&hash));
self.local_collations.collect_garbage(Some(&header.parent_hash)); self.local_collations.collect_garbage(Some(&header.parent_hash));
} }
...@@ -608,7 +613,13 @@ impl Specialization<Block> for PolkadotProtocol { ...@@ -608,7 +613,13 @@ impl Specialization<Block> for PolkadotProtocol {
impl PolkadotProtocol { impl PolkadotProtocol {
// we received a collation from a peer // we received a collation from a peer
fn on_collation(&mut self, ctx: &mut Context<Block>, from: PeerId, relay_parent: Hash, collation: Collation) { fn on_collation(
&mut self,
ctx: &mut dyn Context<Block>,
from: PeerId,
relay_parent: Hash,
collation: Collation
) {
let collation_para = collation.receipt.parachain_index; let collation_para = collation.receipt.parachain_index;
let collated_acc = collation.receipt.collator.clone(); let collated_acc = collation.receipt.collator.clone();
...@@ -656,7 +667,7 @@ impl PolkadotProtocol { ...@@ -656,7 +667,7 @@ impl PolkadotProtocol {
} }
// disconnect a collator by account-id. // disconnect a collator by account-id.
fn disconnect_bad_collator(&mut self, ctx: &mut Context<Block>, collator_id: CollatorId) { fn disconnect_bad_collator(&mut self, ctx: &mut dyn Context<Block>, collator_id: CollatorId) {
if let Some((who, _)) = self.collator_peer(collator_id) { if let Some((who, _)) = self.collator_peer(collator_id) {
ctx.report_peer(who, cost::BAD_COLLATION) ctx.report_peer(who, cost::BAD_COLLATION)
} }
...@@ -667,7 +678,7 @@ impl PolkadotProtocol { ...@@ -667,7 +678,7 @@ impl PolkadotProtocol {
/// Add a local collation and broadcast it to the necessary peers. /// Add a local collation and broadcast it to the necessary peers.
pub fn add_local_collation( pub fn add_local_collation(
&mut self, &mut self,
ctx: &mut Context<Block>, ctx: &mut dyn Context<Block>,
relay_parent: Hash, relay_parent: Hash,
targets: HashSet<SessionKey>, targets: HashSet<SessionKey>,
collation: Collation, collation: Collation,
......
...@@ -154,13 +154,13 @@ impl NetworkService for TestNetwork { ...@@ -154,13 +154,13 @@ impl NetworkService for TestNetwork {
} }
fn with_gossip<F: Send + 'static>(&self, with: F) 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>)
{ {
unimplemented!() unimplemented!()
} }
fn with_spec<F: Send + 'static>(&self, with: F) 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>)
{ {
let mut context = TestContext::default(); let mut context = TestContext::default();
let res = with(&mut *self.proto.lock(), &mut context); let res = with(&mut *self.proto.lock(), &mut context);
......
...@@ -78,11 +78,11 @@ impl Executor for TaskExecutor { ...@@ -78,11 +78,11 @@ impl Executor for TaskExecutor {
/// A gossip network subservice. /// A gossip network subservice.
pub trait GossipService { pub trait GossipService {
fn send_message(&mut self, ctx: &mut NetContext<Block>, who: &PeerId, message: ConsensusMessage); fn send_message(&mut self, ctx: &mut dyn NetContext<Block>, who: &PeerId, message: ConsensusMessage);
} }
impl GossipService for consensus_gossip::ConsensusGossip<Block> { impl GossipService for consensus_gossip::ConsensusGossip<Block> {
fn send_message(&mut self, ctx: &mut NetContext<Block>, who: &PeerId, message: ConsensusMessage) { fn send_message(&mut self, ctx: &mut dyn NetContext<Block>, who: &PeerId, message: ConsensusMessage) {
consensus_gossip::ConsensusGossip::send_message(self, ctx, who, message) consensus_gossip::ConsensusGossip::send_message(self, ctx, who, message)
} }
} }
...@@ -135,7 +135,7 @@ impl NetworkService for super::NetworkService { ...@@ -135,7 +135,7 @@ impl NetworkService for super::NetworkService {
} }
fn with_spec<F: Send + 'static>(&self, with: F) 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>)
{ {
super::NetworkService::with_spec(self, with) super::NetworkService::with_spec(self, with)
} }
...@@ -260,7 +260,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where ...@@ -260,7 +260,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
{ {
type Error = String; type Error = String;
type TableRouter = Router<P, E, N, T>; type TableRouter = Router<P, E, N, T>;
type BuildTableRouter = Box<Future<Item=Self::TableRouter,Error=String> + Send>; type BuildTableRouter = Box<dyn Future<Item=Self::TableRouter, Error=String> + Send>;
fn communication_for( fn communication_for(
&self, &self,
......
...@@ -77,8 +77,11 @@ pub type SessionKey = ed25519::Public; ...@@ -77,8 +77,11 @@ pub type SessionKey = ed25519::Public;
/// that 32 bits may be multiplied with a balance in 128 bits without worrying about overflow. /// that 32 bits may be multiplied with a balance in 128 bits without worrying about overflow.
pub type Balance = u128; pub type Balance = u128;
/// The Ed25519 pub key of an session that belongs to an Aura authority of the chain.
pub type AuraId = ed25519::Public;
/// Header type. /// Header type.
pub type Header = generic::Header<BlockNumber, BlakeTwo256, generic::DigestItem<Hash, SessionKey, SessionSignature>>; pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type. /// Block type.
pub type Block = generic::Block<Header, UncheckedExtrinsic>; pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// Block ID. /// Block ID.
......
...@@ -24,7 +24,6 @@ consensus_aura = { package = "substrate-consensus-aura-primitives", git = "https ...@@ -24,7 +24,6 @@ consensus_aura = { package = "substrate-consensus-aura-primitives", git = "https
offchain_primitives = { package = "substrate-offchain-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } offchain_primitives = { package = "substrate-offchain-primitives", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
aura = { package = "srml-aura", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } aura = { package = "srml-aura", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
balances = { package = "srml-balances", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } balances = { package = "srml-balances", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
consensus = { package = "srml-consensus", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
council = { package = "srml-council", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } council = { package = "srml-council", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
democracy = { package = "srml-democracy", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } democracy = { package = "srml-democracy", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
executive = { package = "srml-executive", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } executive = { package = "srml-executive", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
...@@ -38,7 +37,6 @@ system = { package = "srml-system", git = "https://github.com/paritytech/substra ...@@ -38,7 +37,6 @@ system = { package = "srml-system", git = "https://github.com/paritytech/substra
timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } timestamp = { package = "srml-timestamp", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
treasury = { package = "srml-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } treasury = { package = "srml-treasury", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
version = { package = "sr-version", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" } version = { package = "sr-version", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
consensus_authorities = { package = "substrate-consensus-authorities", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
[dev-dependencies] [dev-dependencies]
hex-literal = "0.2.0" hex-literal = "0.2.0"
...@@ -63,7 +61,6 @@ std = [ ...@@ -63,7 +61,6 @@ std = [
"sr-io/std", "sr-io/std",
"srml-support/std", "srml-support/std",
"balances/std", "balances/std",
"consensus/std",
"council/std", "council/std",
"democracy/std", "democracy/std",
"executive/std", "executive/std",
...@@ -81,7 +78,6 @@ std = [ ...@@ -81,7 +78,6 @@ std = [
"serde/std", "serde/std",
"log", "log",
"safe-mix/std", "safe-mix/std",
"consensus_authorities/std",
"consensus_aura/std", "consensus_aura/std",
"aura/std", "aura/std",
] ]
...@@ -193,7 +193,7 @@ mod tests { ...@@ -193,7 +193,7 @@ mod tests {
// The testing primitives are very useful for avoiding having to work with signatures // The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sr_primitives::{ use sr_primitives::{
BuildStorage, traits::{BlakeTwo256, IdentityLookup}, testing::{Digest, DigestItem, Header} BuildStorage, traits::{BlakeTwo256, IdentityLookup}, testing::Header
}; };
use balances; use balances;
use srml_support::{impl_outer_origin, assert_ok, assert_err, assert_noop}; use srml_support::{impl_outer_origin, assert_ok, assert_err, assert_noop};
...@@ -213,12 +213,10 @@ mod tests { ...@@ -213,12 +213,10 @@ mod tests {
type BlockNumber = u64; type BlockNumber = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type Digest = Digest;
type AccountId = u64; type AccountId = u64;
type Lookup = IdentityLookup<u64>; type Lookup = IdentityLookup<u64>;
type Header = Header; type Header = Header;
type Event = (); type Event = ();
type Log = DigestItem;
} }
impl balances::Trait for Test { impl balances::Trait for Test {