mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
Use correct CreateInherentDataProviders impl for manual seal (#8852)
* use correct CreateInherentDataProviders impl for manual seal * add babe inherent provider * move client into factory fn
This commit is contained in:
@@ -268,7 +268,7 @@ impl SlotTimestampProvider {
|
||||
|
||||
// looks like this isn't the first block, rehydrate the fake time.
|
||||
// otherwise we'd be producing blocks for older slots.
|
||||
let duration = if info.best_number != Zero::zero() {
|
||||
let time = if info.best_number != Zero::zero() {
|
||||
let header = client.header(BlockId::Hash(info.best_hash))?.unwrap();
|
||||
let slot = find_pre_digest::<B>(&header).unwrap().slot();
|
||||
// add the slot duration so there's no collision of slots
|
||||
@@ -282,10 +282,15 @@ impl SlotTimestampProvider {
|
||||
};
|
||||
|
||||
Ok(Self {
|
||||
time: atomic::AtomicU64::new(duration),
|
||||
time: atomic::AtomicU64::new(time),
|
||||
slot_duration,
|
||||
})
|
||||
}
|
||||
|
||||
/// Get the current slot number
|
||||
pub fn slot(&self) -> u64 {
|
||||
self.time.load(atomic::Ordering::SeqCst) / self.slot_duration
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
||||
@@ -111,10 +111,7 @@ pub async fn seal_block<B, BI, SC, C, E, P, CIDP>(
|
||||
|
||||
let inherent_data_providers =
|
||||
create_inherent_data_providers
|
||||
.create_inherent_data_providers(
|
||||
parent.hash(),
|
||||
(),
|
||||
)
|
||||
.create_inherent_data_providers(parent.hash(), ())
|
||||
.await
|
||||
.map_err(|e| Error::Other(e))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user