node: use BABE predigest data to find authorship (#3293)

* node: use BABE predigest data to find authorship

* node: bump spec_version

* babe: use u32 for authority index
This commit is contained in:
André Silva
2019-08-02 18:52:36 +01:00
committed by Gavin Wood
parent da8b91ae7b
commit aa86185648
4 changed files with 8 additions and 9 deletions
+3 -3
View File
@@ -202,8 +202,8 @@ impl<T: Trait> RandomnessBeacon for Module<T> {
/// A BABE public key
pub type BabeKey = [u8; PUBLIC_KEY_LENGTH];
impl<T: Trait> FindAuthor<u64> for Module<T> {
fn find_author<'a, I>(digests: I) -> Option<u64> where
impl<T: Trait> FindAuthor<u32> for Module<T> {
fn find_author<'a, I>(digests: I) -> Option<u32> where
I: 'a + IntoIterator<Item=(ConsensusEngineId, &'a [u8])>
{
for (id, mut data) in digests.into_iter() {
@@ -341,7 +341,7 @@ impl<T: Trait + staking::Trait> session::OneSessionHandler<T::AccountId> for Mod
}
fn on_disabled(i: usize) {
Self::deposit_consensus(ConsensusLog::OnDisabled(i as u64))
Self::deposit_consensus(ConsensusLog::OnDisabled(i as u32))
}
}