fix #2177: port GRANDPA node-side code to use Consensus digests (#3669)

* fix #2177: port GRANDPA node-side code to use Consensus digests

* bump runtime version

* fix service compilation

* document change precedence rules
This commit is contained in:
Robert Habermeier
2019-09-24 10:45:44 +02:00
committed by GitHub
parent 5c39f588be
commit 4888c253a3
10 changed files with 138 additions and 247 deletions
+2 -14
View File
@@ -30,7 +30,7 @@ use node_primitives::{
Moment, Signature, ContractExecResult,
};
use babe_primitives::{AuthorityId as BabeId};
use grandpa::fg_primitives::{self, ScheduledChange};
use grandpa::fg_primitives;
use client::{
block_builder::api::{self as block_builder_api, InherentData, CheckInherentsResult},
runtime_api as client_api, impl_runtime_apis
@@ -42,7 +42,7 @@ use sr_primitives::curve::PiecewiseLinear;
use sr_primitives::transaction_validity::TransactionValidity;
use sr_primitives::weights::Weight;
use sr_primitives::traits::{
self, BlakeTwo256, Block as BlockT, DigestFor, NumberFor, StaticLookup, SaturatedConversion,
self, BlakeTwo256, Block as BlockT, NumberFor, StaticLookup, SaturatedConversion,
};
use version::RuntimeVersion;
use elections::VoteIndex;
@@ -596,18 +596,6 @@ impl_runtime_apis! {
}
impl fg_primitives::GrandpaApi<Block> for Runtime {
fn grandpa_pending_change(digest: &DigestFor<Block>)
-> Option<ScheduledChange<NumberFor<Block>>>
{
Grandpa::pending_change(digest)
}
fn grandpa_forced_change(digest: &DigestFor<Block>)
-> Option<(NumberFor<Block>, ScheduledChange<NumberFor<Block>>)>
{
Grandpa::forced_change(digest)
}
fn grandpa_authorities() -> Vec<(GrandpaId, GrandpaWeight)> {
Grandpa::grandpa_authorities()
}