Commit 8088e5b9 authored by Yuanchao Sun's avatar Yuanchao Sun Committed by Bastian Köcher
Browse files

Fix no pre-runtime digest error (#298)

parent 7545a340
Pipeline #41198 passed with stages
in 22 minutes and 56 seconds
...@@ -574,7 +574,7 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where ...@@ -574,7 +574,7 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where
fn propose(&self, fn propose(&self,
inherent_data: InherentData, inherent_data: InherentData,
_inherent_digests: DigestFor<Block>, inherent_digests: DigestFor<Block>,
max_duration: Duration, max_duration: Duration,
) -> Self::Create { ) -> Self::Create {
const ATTEMPT_PROPOSE_EVERY: Duration = Duration::from_millis(100); const ATTEMPT_PROPOSE_EVERY: Duration = Duration::from_millis(100);
...@@ -627,6 +627,7 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where ...@@ -627,6 +627,7 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where
believed_minimum_timestamp: believed_timestamp, believed_minimum_timestamp: believed_timestamp,
timing, timing,
inherent_data: Some(inherent_data), inherent_data: Some(inherent_data),
inherent_digests: inherent_digests,
// leave some time for the proposal finalisation // leave some time for the proposal finalisation
deadline: Instant::now() + max_duration - max_duration / 3, deadline: Instant::now() + max_duration - max_duration / 3,
}) })
...@@ -697,6 +698,7 @@ pub struct CreateProposal<C: Send + Sync, TxApi: PoolChainApi> { ...@@ -697,6 +698,7 @@ pub struct CreateProposal<C: Send + Sync, TxApi: PoolChainApi> {
timing: ProposalTiming, timing: ProposalTiming,
believed_minimum_timestamp: u64, believed_minimum_timestamp: u64,
inherent_data: Option<InherentData>, inherent_data: Option<InherentData>,
inherent_digests: DigestFor<Block>,
deadline: Instant, deadline: Instant,
} }
...@@ -718,7 +720,7 @@ impl<C, TxApi> CreateProposal<C, TxApi> where ...@@ -718,7 +720,7 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
let runtime_api = self.client.runtime_api(); let runtime_api = self.client.runtime_api();
let mut block_builder = BlockBuilder::at_block(&self.parent_id, &*self.client, false, Default::default())?; let mut block_builder = BlockBuilder::at_block(&self.parent_id, &*self.client, false, self.inherent_digests.clone())?;
{ {
let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?; let inherents = runtime_api.inherent_extrinsics(&self.parent_id, inherent_data)?;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment