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
@@ -34,7 +34,7 @@ extern crate substrate_client as client;
extern crate sr_std as rstd;
use substrate_primitives::AuthorityId;
use substrate_primitives::Ed25519AuthorityId;
use sr_primitives::traits::{DigestFor, NumberFor};
use rstd::vec::Vec;
@@ -43,7 +43,7 @@ use rstd::vec::Vec;
#[derive(Clone, Encode, Decode)]
pub struct ScheduledChange<N> {
/// The new authorities after the change, along with their respective weights.
pub next_authorities: Vec<(AuthorityId, u64)>,
pub next_authorities: Vec<(Ed25519AuthorityId, u64)>,
/// The number of blocks to delay.
pub delay: N,
}
@@ -97,6 +97,6 @@ decl_runtime_apis! {
/// Get the current GRANDPA authorities and weights. This should not change except
/// for when changes are scheduled and the corresponding delay has passed.
fn grandpa_authorities() -> Vec<(AuthorityId, u64)>;
fn grandpa_authorities() -> Vec<(Ed25519AuthorityId, u64)>;
}
}