Companion for Substrate#14612 (#2923)

* Companion for Substrate#14612

https://github.com/paritytech/substrate/pull/14612

* Remove patch

* Cargo.lock

* Fix

* Fix compilation

* Fix Fix

* ...

* :face_palm:

* .................

* update lockfile for {"polkadot", "substrate"}

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2023-08-17 14:39:09 +02:00
committed by GitHub
parent 061eee1382
commit 02691d94d8
20 changed files with 332 additions and 398 deletions
+3 -8
View File
@@ -50,14 +50,11 @@ impl Error {
/// A type alias for easily referring to the type of a proposal produced by a specific
/// [`Proposer`].
pub type ProposalOf<B, T> = Proposal<B, <T as ProposerInterface<B>>::Transaction, StorageProof>;
pub type ProposalOf<B> = Proposal<B, StorageProof>;
/// An interface for proposers.
#[async_trait]
pub trait ProposerInterface<Block: BlockT> {
/// The underlying DB transaction type produced with the block proposal.
type Transaction: Default + Send + 'static;
/// Propose a collation using the supplied `InherentData` and the provided
/// `ParachainInherentData`.
///
@@ -79,7 +76,7 @@ pub trait ProposerInterface<Block: BlockT> {
inherent_digests: Digest,
max_duration: Duration,
block_size_limit: Option<usize>,
) -> Result<Proposal<Block, Self::Transaction, StorageProof>, Error>;
) -> Result<Proposal<Block, StorageProof>, Error>;
}
/// A simple wrapper around a Substrate proposer for creating collations.
@@ -104,8 +101,6 @@ where
T::Proposer: SubstrateProposer<B, ProofRecording = EnableProofRecording, Proof = StorageProof>,
<T::Proposer as SubstrateProposer<B>>::Error: Send + Sync + 'static,
{
type Transaction = <<T as Environment<B>>::Proposer as SubstrateProposer<B>>::Transaction;
async fn propose(
&mut self,
parent_header: &B::Header,
@@ -114,7 +109,7 @@ where
inherent_digests: Digest,
max_duration: Duration,
block_size_limit: Option<usize>,
) -> Result<Proposal<B, Self::Transaction, StorageProof>, Error> {
) -> Result<Proposal<B, StorageProof>, Error> {
let proposer = self
.inner
.init(parent_header)