Merge branch 'master' into rh-grandpa-dynamic2

This commit is contained in:
Robert Habermeier
2018-11-14 14:32:30 +01:00
235 changed files with 9413 additions and 3020 deletions
+7 -22
View File
@@ -130,22 +130,7 @@ pub trait CompatibleDigestItem: Sized {
fn as_aura_seal(&self) -> Option<(u64, &ed25519::Signature)>;
}
impl CompatibleDigestItem for generic::DigestItem<primitives::H256, u64> {
/// Construct a digest item which is a slot number and a signature on the
/// hash.
fn aura_seal(slot_number: u64, signature: ed25519::Signature) -> Self {
generic::DigestItem::Seal(slot_number, signature)
}
/// If this item is an Aura seal, return the slot number and signature.
fn as_aura_seal(&self) -> Option<(u64, &ed25519::Signature)> {
match self {
generic::DigestItem::Seal(slot, ref sign) => Some((*slot, sign)),
_ => None
}
}
}
impl CompatibleDigestItem for generic::DigestItem<primitives::H256, primitives::AuthorityId> {
impl<Hash, AuthorityId> CompatibleDigestItem for generic::DigestItem<Hash, AuthorityId> {
/// Construct a digest item which is a slot number and a signature on the
/// hash.
fn aura_seal(slot_number: u64, signature: ed25519::Signature) -> Self {
@@ -255,8 +240,8 @@ pub fn start_aura<B, C, E, SO, Error>(
let import_block = ImportBlock {
origin: BlockOrigin::Own,
header,
external_justification: Vec::new(),
post_runtime_digests: vec![item],
justification: Vec::new(),
post_digests: vec![item],
body: Some(body),
finalized: false,
auxiliary: Vec::new(),
@@ -380,8 +365,8 @@ impl<B: Block, C> Verifier<B> for AuraVerifier<C> where
let import_block = ImportBlock {
origin,
header: pre_header,
external_justification: Vec::new(),
post_runtime_digests: vec![item],
justification: Vec::new(),
post_digests: vec![item],
body,
finalized: false,
auxiliary: Vec::new(),
@@ -420,7 +405,7 @@ mod tests {
use network::test::*;
use network::test::{Block as TestBlock, PeersClient};
use runtime_primitives::traits::Block as BlockT;
use network::ProtocolConfig;
use network::config::ProtocolConfig;
use parking_lot::Mutex;
use tokio::runtime::current_thread;
use keyring::Keyring;
@@ -429,7 +414,7 @@ mod tests {
type Error = client::error::Error;
type TestClient = client::Client<test_client::Backend, test_client::Executor, TestBlock>;
type TestClient = client::Client<test_client::Backend, test_client::Executor, TestBlock, test_client::runtime::ClientWithApi>;
struct DummyFactory(Arc<TestClient>);
struct DummyProposer(u64, Arc<TestClient>);