PoC-1 consensus extracted to "rhododendron" (#284)

This commit is contained in:
Robert Habermeier
2018-07-09 10:26:04 +01:00
committed by Gav Wood
parent 9b254c3075
commit 374984fe35
18 changed files with 135 additions and 2273 deletions
@@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
rhododendron = "0.2"
substrate-bft = { path = "../bft" }
substrate-client = { path = "../client" }
substrate-codec = { path = "../codec" }
@@ -68,22 +68,22 @@ fn fake_justify(header: &runtime::Header) -> bft::UncheckedJustification<runtime
Keyring::Charlie.into(),
];
bft::UncheckedJustification {
digest: hash,
signatures: authorities.iter().map(|key| {
bft::UncheckedJustification::new(
hash,
authorities.iter().map(|key| {
let msg = bft::sign_message::<runtime::Block>(
bft::generic::Vote::Commit(1, hash).into(),
::rhododendron::Vote::Commit(1, hash).into(),
key,
header.parent_hash
);
match msg {
bft::generic::LocalizedMessage::Vote(vote) => vote.signature,
::rhododendron::LocalizedMessage::Vote(vote) => vote.signature,
_ => panic!("signing vote leads to signed vote"),
}
}).collect(),
round_number: 1,
}
1,
)
}
fn genesis_config() -> GenesisConfig {
@@ -18,6 +18,7 @@
#![warn(missing_docs)]
extern crate rhododendron;
extern crate substrate_bft as bft;
extern crate substrate_codec as codec;
extern crate substrate_keyring as keyring;