Consistency with the Block trait name (#3129)

* Consistency with the Block trait name

* Line widths
This commit is contained in:
Pierre Krieger
2019-07-16 16:32:46 +02:00
committed by André Silva
parent 768eb1af4d
commit a22bb71029
7 changed files with 80 additions and 70 deletions
+11 -11
View File
@@ -37,7 +37,7 @@ use consensus_common::import_queue::{
use consensus_common::well_known_cache_keys::Id as CacheKeyId;
use runtime_primitives::{generic, generic::{BlockId, OpaqueDigestItemId}, Justification};
use runtime_primitives::traits::{
Block, Header, DigestItemFor, ProvideRuntimeApi,
Block as BlockT, Header, DigestItemFor, ProvideRuntimeApi,
SimpleBitOps, Zero,
};
use std::{sync::Arc, u64, fmt::{Debug, Display}, time::{Instant, Duration}};
@@ -95,7 +95,7 @@ pub struct Config(slots::SlotDuration<BabeConfiguration>);
impl Config {
/// Either fetch the slot duration from disk or compute it from the genesis
/// state.
pub fn get_or_compute<B: Block, C>(client: &C) -> CResult<Self>
pub fn get_or_compute<B: BlockT, C>(client: &C) -> CResult<Self>
where
C: AuxStore + ProvideRuntimeApi, C::Api: BabeApi<B>,
{
@@ -185,7 +185,7 @@ pub fn start_babe<B, C, SC, E, I, SO, Error, H>(BabeParams {
impl Future<Item=(), Error=()>,
consensus_common::Error,
> where
B: Block<Header=H>,
B: BlockT<Header=H>,
C: ProvideRuntimeApi + ProvideCache<B>,
C::Api: BabeApi<B>,
SC: SelectChain<B>,
@@ -228,7 +228,7 @@ struct BabeWorker<C, E, I, SO> {
}
impl<Hash, H, B, C, E, I, Error, SO> SlotWorker<B> for BabeWorker<C, E, I, SO> where
B: Block<Header=H, Hash=Hash>,
B: BlockT<Header=H, Hash=Hash>,
C: ProvideRuntimeApi + ProvideCache<B>,
C::Api: BabeApi<B>,
E: Environment<B, Error=Error>,
@@ -418,7 +418,7 @@ macro_rules! babe_err {
};
}
fn find_pre_digest<B: Block>(header: &B::Header) -> Result<BabePreDigest, String>
fn find_pre_digest<B: BlockT>(header: &B::Header) -> Result<BabePreDigest, String>
where DigestItemFor<B>: CompatibleDigestItem,
{
let mut pre_digest: Option<_> = None;
@@ -443,7 +443,7 @@ fn find_pre_digest<B: Block>(header: &B::Header) -> Result<BabePreDigest, String
/// This digest item will always return `Some` when used with `as_babe_pre_digest`.
//
// FIXME #1018 needs misbehavior types
fn check_header<B: Block + Sized, C: AuxStore>(
fn check_header<B: BlockT + Sized, C: AuxStore>(
client: &C,
slot_now: u64,
mut header: B::Header,
@@ -531,7 +531,7 @@ pub struct BabeVerifier<C> {
}
impl<C> BabeVerifier<C> {
fn check_inherents<B: Block>(
fn check_inherents<B: BlockT>(
&self,
block: B,
block_id: BlockId<B>,
@@ -587,7 +587,7 @@ fn median_algorithm(
}
}
impl<B: Block, C> Verifier<B> for BabeVerifier<C> where
impl<B: BlockT, C> Verifier<B> for BabeVerifier<C> where
C: ProvideRuntimeApi + Send + Sync + AuxStore + ProvideCache<B>,
C::Api: BlockBuilderApi<B> + BabeApi<B>,
DigestItemFor<B>: CompatibleDigestItem,
@@ -701,7 +701,7 @@ fn authorities<B, C>(client: &C, at: &BlockId<B>) -> Result<
Vec<AuthorityId>,
ConsensusError,
> where
B: Block,
B: BlockT,
C: ProvideRuntimeApi + ProvideCache<B>,
C::Api: BabeApi<B>,
{
@@ -796,7 +796,7 @@ fn claim_slot(
}
fn initialize_authorities_cache<B, C>(client: &C) -> Result<(), ConsensusError> where
B: Block,
B: BlockT,
C: ProvideRuntimeApi + ProvideCache<B>,
C::Api: BabeApi<B>,
{
@@ -834,7 +834,7 @@ pub fn import_queue<B, C, E>(
client: Arc<C>,
inherent_data_providers: InherentDataProviders,
) -> Result<(BabeImportQueue<B>, BabeLink), consensus_common::Error> where
B: Block,
B: BlockT,
C: 'static + ProvideRuntimeApi + ProvideCache<B> + Send + Sync + AuxStore,
C::Api: BlockBuilderApi<B> + BabeApi<B>,
DigestItemFor<B>: CompatibleDigestItem,