Make AuthorityId generic (#1296)

* BlockAuthorityId convenience type

* Rename AuthorityId -> Ed25519AuthorityId to make it more precise

* Generalize AuthorityId up to substrate-client

* Fix in client-db

* rename: BlockAuthorityId -> AuthorityIdFor

* typo: should be digest item

* Fix test-runtime authorityId mismatch

One states that AuthorityId is u64 while the other states that it's Ed25519AuthorityId.

* Fix more u64 - Ed25519AuthorityId mismatch

* Fix compile of most of the srml modules

* Continue to pin aura and grandpa with ed25519 and fix compile

* Add MaybeHash trait

* Fix node-runtime compile

* Fix network tests
This commit is contained in:
Wei Tang
2019-01-08 11:14:18 +01:00
committed by Benjamin Kampmann
parent 043831cfb0
commit 71d889b692
46 changed files with 234 additions and 216 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ use runtime_support::dispatch::Result;
use runtime_support::storage::StorageValue;
use runtime_support::storage::unhashed::StorageVec;
use primitives::traits::{CurrentHeight, Convert};
use substrate_primitives::AuthorityId;
use substrate_primitives::Ed25519AuthorityId;
use system::ensure_signed;
use primitives::traits::MaybeSerializeDebug;
@@ -105,7 +105,7 @@ impl<N: Clone, SessionKey> RawLog<N, SessionKey> {
}
impl<N, SessionKey> GrandpaChangeSignal<N> for RawLog<N, SessionKey>
where N: Clone, SessionKey: Clone + Into<AuthorityId>,
where N: Clone, SessionKey: Clone + Into<Ed25519AuthorityId>,
{
fn as_signal(&self) -> Option<ScheduledChange<N>> {
RawLog::as_signal(self).map(|(delay, next_authorities)| ScheduledChange {
@@ -243,7 +243,7 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> Module<T> where AuthorityId: core::convert::From<<T as Trait>::SessionKey> {
impl<T: Trait> Module<T> where Ed25519AuthorityId: core::convert::From<<T as Trait>::SessionKey> {
/// See if the digest contains any scheduled change.
pub fn scrape_digest_change(log: &Log<T>)
-> Option<ScheduledChange<T::BlockNumber>>