feat: generalize ConsensusDataProvider for manual-seal (#11827)

* feat: generalize ConsensusDataProvider for manual-seal

* rename all generic type param `proof`/`PROOF` to `P`

* rename a missing thing

* Update client/consensus/manual-seal/src/consensus.rs

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Update client/consensus/manual-seal/src/consensus/babe.rs

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Update client/consensus/manual-seal/src/consensus/aura.rs

Co-authored-by: Davide Galassi <davxy@datawok.net>

Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
yjh
2022-07-30 06:07:34 +08:00
committed by GitHub
parent 56f16f5500
commit e82da9d499
5 changed files with 49 additions and 25 deletions
@@ -33,6 +33,9 @@ pub trait ConsensusDataProvider<B: BlockT>: Send + Sync {
/// Block import transaction type
type Transaction;
/// The proof type.
type Proof;
/// Attempt to create a consensus digest.
fn create_digest(&self, parent: &B::Header, inherents: &InherentData) -> Result<Digest, Error>;
@@ -42,5 +45,6 @@ pub trait ConsensusDataProvider<B: BlockT>: Send + Sync {
parent: &B::Header,
params: &mut BlockImportParams<B, Self::Transaction>,
inherents: &InherentData,
proof: Self::Proof,
) -> Result<(), Error>;
}