Documentation for consensus module (#2043)

* first try

* resolve description of grandpa and add links to relevant docs

* Update srml/consensus/src/lib.rs

Co-Authored-By: AmarRSingh <asinghchrony@protonmail.com>

* Can do a relative link here

* Update srml/consensus/src/lib.rs

Co-Authored-By: AmarRSingh <asinghchrony@protonmail.com>

* Update srml/consensus/src/lib.rs

Co-Authored-By: AmarRSingh <asinghchrony@protonmail.com>

* Update srml/consensus/src/lib.rs

Co-Authored-By: AmarRSingh <asinghchrony@protonmail.com>

* formatting/style/semantics

* missed conflict

* style

* Update srml/consensus/src/lib.rs

* Update srml/consensus/src/lib.rs
This commit is contained in:
Amar Singh
2019-03-29 17:41:36 +01:00
committed by Gav Wood
parent cbfc36b39f
commit b1f9c31f21
3 changed files with 140 additions and 15 deletions
+21
View File
@@ -44,6 +44,27 @@ fn authorities_change_logged() {
});
}
#[test]
fn partial_authorities_change_logged() {
with_externalities(&mut new_test_ext(vec![1, 2, 3]), || {
System::initialise(&2, &Default::default(), &Default::default());
Consensus::set_authorities(&[UintAuthorityId(2), UintAuthorityId(4), UintAuthorityId(5)]);
Consensus::on_finalise(2);
let header = System::finalise();
assert_eq!(header.digest, testing::Digest {
logs: vec![
generic::DigestItem::AuthoritiesChange(
vec![
UintAuthorityId(2).into(),
UintAuthorityId(4).into(),
UintAuthorityId(5).into()
]
),
],
});
});
}
#[test]
fn authorities_change_is_not_logged_when_not_changed() {
with_externalities(&mut new_test_ext(vec![1, 2, 3]), || {