mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
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:
committed by
Benjamin Kampmann
parent
043831cfb0
commit
71d889b692
@@ -20,16 +20,16 @@ use client::{self, Client as SubstrateClient, ClientInfo, BlockStatus, CallExecu
|
||||
use client::error::Error;
|
||||
use client::light::fetcher::ChangesProof;
|
||||
use consensus::{BlockImport, Error as ConsensusError};
|
||||
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT};
|
||||
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, AuthorityIdFor};
|
||||
use runtime_primitives::generic::{BlockId};
|
||||
use consensus::{ImportBlock, ImportResult};
|
||||
use runtime_primitives::Justification;
|
||||
use primitives::{H256, Blake2Hasher, AuthorityId};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
|
||||
/// Local client abstraction for the network.
|
||||
pub trait Client<Block: BlockT>: Send + Sync {
|
||||
/// Import a new block. Parent is supposed to be existing in the blockchain.
|
||||
fn import(&self, block: ImportBlock<Block>, new_authorities: Option<Vec<AuthorityId>>)
|
||||
fn import(&self, block: ImportBlock<Block>, new_authorities: Option<Vec<AuthorityIdFor<Block>>>)
|
||||
-> Result<ImportResult, ConsensusError>;
|
||||
|
||||
/// Get blockchain info.
|
||||
@@ -77,7 +77,7 @@ impl<B, E, Block, RA> Client<Block> for SubstrateClient<B, E, Block, RA> where
|
||||
Block: BlockT<Hash=H256>,
|
||||
RA: Send + Sync
|
||||
{
|
||||
fn import(&self, block: ImportBlock<Block>, new_authorities: Option<Vec<AuthorityId>>)
|
||||
fn import(&self, block: ImportBlock<Block>, new_authorities: Option<Vec<AuthorityIdFor<Block>>>)
|
||||
-> Result<ImportResult, ConsensusError>
|
||||
{
|
||||
(self as &SubstrateClient<B, E, Block, RA>).import_block(block, new_authorities)
|
||||
|
||||
Reference in New Issue
Block a user