mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-11 17:35:43 +00:00
PoC-1 consensus extracted to "rhododendron" (#284)
This commit is contained in:
committed by
Gav Wood
parent
9b254c3075
commit
374984fe35
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user