Integrate Approval Voting into Overseer / Service / GRANDPA (#2412)

* integrate approval voting into overseer

* expose public API and make keystore arc

* integrate overseer in service

* guide: `ApprovedAncestor` returns block number

* return block number along with hash from ApprovedAncestor

* introduce a voting rule for reporting on approval checking

* integrate the delay voting rule

* Rococo configuration

* fix compilation and add slack

* fix web-wasm build

* tweak parameterization

* migrate voting rules to asycn

* remove hack comment
This commit is contained in:
Robert Habermeier
2021-02-15 22:37:13 -06:00
committed by GitHub
parent 5c68e6f9cc
commit 4f21cc7e5c
11 changed files with 321 additions and 66 deletions
@@ -184,7 +184,7 @@ impl DBReader for TestStore {
fn blank_state() -> State<TestStore> {
State {
session_window: import::RollingSessionWindow::default(),
keystore: LocalKeystore::in_memory(),
keystore: Arc::new(LocalKeystore::in_memory()),
slot_duration_millis: SLOT_DURATION_MILLIS,
db: TestStore::default(),
clock: Box::new(MockClock::default()),
@@ -1490,7 +1490,7 @@ fn approved_ancestor_all_approved() {
let test_fut = Box::pin(async move {
assert_eq!(
handle_approved_ancestor(&mut ctx, &state.db, block_hash_4, 0).await.unwrap(),
Some(block_hash_4),
Some((block_hash_4, 4)),
)
});
@@ -1572,7 +1572,7 @@ fn approved_ancestor_missing_approval() {
let test_fut = Box::pin(async move {
assert_eq!(
handle_approved_ancestor(&mut ctx, &state.db, block_hash_4, 0).await.unwrap(),
Some(block_hash_2),
Some((block_hash_2, 2)),
)
});