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
+4 -4
View File
@@ -19,8 +19,8 @@
#![cfg(test)]
use primitives::BuildStorage;
use primitives::{Perbill, traits::Identity};
use primitives::testing::{Digest, DigestItem, Header};
use primitives::Perbill;
use primitives::testing::{Digest, DigestItem, Header, UintAuthorityId, ConvertUintAuthorityId};
use substrate_primitives::{H256, Blake2Hasher};
use runtime_io;
use {GenesisConfig, Module, Trait, consensus, session, system, timestamp, balances};
@@ -35,7 +35,7 @@ pub struct Test;
impl consensus::Trait for Test {
const NOTE_OFFLINE_POSITION: u32 = 1;
type Log = DigestItem;
type SessionKey = u64;
type SessionKey = UintAuthorityId;
type InherentOfflineReport = ();
}
impl system::Trait for Test {
@@ -58,7 +58,7 @@ impl balances::Trait for Test {
type Event = ();
}
impl session::Trait for Test {
type ConvertAccountIdToSessionKey = Identity;
type ConvertAccountIdToSessionKey = ConvertUintAuthorityId;
type OnSessionChange = Staking;
type Event = ();
}