mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Rewrap all comments to 100 line width (#9490)
* reformat everything again * manual formatting * last manual fix * Fix build
This commit is contained in:
@@ -143,8 +143,8 @@ pub struct StartAuraParams<C, SC, I, PF, SO, L, CIDP, BS, CAW> {
|
||||
/// The proportion of the slot dedicated to proposing.
|
||||
///
|
||||
/// The block proposing will be limited to this proportion of the slot from the starting of the
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor applied,
|
||||
/// because there were no blocks produced for some slots.
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor
|
||||
/// applied, because there were no blocks produced for some slots.
|
||||
pub block_proposal_slot_portion: SlotProportion,
|
||||
/// The maximum proportion of the slot dedicated to proposing with any lenience factor applied
|
||||
/// due to no blocks being produced.
|
||||
@@ -237,8 +237,8 @@ pub struct BuildAuraWorkerParams<C, I, PF, SO, L, BS> {
|
||||
/// The proportion of the slot dedicated to proposing.
|
||||
///
|
||||
/// The block proposing will be limited to this proportion of the slot from the starting of the
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor applied,
|
||||
/// because there were no blocks produced for some slots.
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor
|
||||
/// applied, because there were no blocks produced for some slots.
|
||||
pub block_proposal_slot_portion: SlotProportion,
|
||||
/// The maximum proportion of the slot dedicated to proposing with any lenience factor applied
|
||||
/// due to no blocks being produced.
|
||||
|
||||
@@ -430,8 +430,8 @@ pub struct BabeParams<B: BlockT, C, SC, E, I, SO, L, CIDP, BS, CAW> {
|
||||
/// The proportion of the slot dedicated to proposing.
|
||||
///
|
||||
/// The block proposing will be limited to this proportion of the slot from the starting of the
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor applied,
|
||||
/// because there were no blocks produced for some slots.
|
||||
/// slot. However, the proposing can still take longer when there is some lenience factor
|
||||
/// applied, because there were no blocks produced for some slots.
|
||||
pub block_proposal_slot_portion: SlotProportion,
|
||||
|
||||
/// The maximum proportion of the slot dedicated to proposing with any lenience factor applied
|
||||
|
||||
@@ -250,8 +250,8 @@ impl<Block: BlockT, Transaction> BlockImportParams<Block, Transaction> {
|
||||
|
||||
/// Auxiliary function for "converting" the transaction type.
|
||||
///
|
||||
/// Actually this just sets `StorageChanges::Changes` to `None` and makes rustc think that `Self` now
|
||||
/// uses a different transaction type.
|
||||
/// Actually this just sets `StorageChanges::Changes` to `None` and makes rustc think that
|
||||
/// `Self` now uses a different transaction type.
|
||||
pub fn clear_storage_changes_and_mutate<Transaction2>(
|
||||
self,
|
||||
) -> BlockImportParams<Block, Transaction2> {
|
||||
|
||||
@@ -54,10 +54,11 @@ impl<T> Drop for SharedDataLockedUpgradable<T> {
|
||||
/// Created by [`SharedData::shared_data_locked`].
|
||||
///
|
||||
/// As long as this object isn't dropped, the shared data is held in a mutex guard and the shared
|
||||
/// data is tagged as locked. Access to the shared data is provided through [`Deref`](std::ops::Deref) and
|
||||
/// [`DerefMut`](std::ops::DerefMut). The trick is to use [`Self::release_mutex`] to release the mutex, but still keep
|
||||
/// the shared data locked. This means every other thread trying to access the shared data in this
|
||||
/// time will need to wait until this lock is freed.
|
||||
/// data is tagged as locked. Access to the shared data is provided through
|
||||
/// [`Deref`](std::ops::Deref) and [`DerefMut`](std::ops::DerefMut). The trick is to use
|
||||
/// [`Self::release_mutex`] to release the mutex, but still keep the shared data locked. This means
|
||||
/// every other thread trying to access the shared data in this time will need to wait until this
|
||||
/// lock is freed.
|
||||
///
|
||||
/// If this object is dropped without calling [`Self::release_mutex`], the lock will be dropped
|
||||
/// immediately.
|
||||
@@ -210,8 +211,8 @@ impl<T> SharedData<T> {
|
||||
///
|
||||
/// This will give mutable access to the shared data. The returned [`SharedDataLocked`]
|
||||
/// provides the function [`SharedDataLocked::release_mutex`] to release the mutex, but
|
||||
/// keeping the data locked. This is useful in async contexts for example where the data needs to
|
||||
/// be locked, but a mutex guard can not be held.
|
||||
/// keeping the data locked. This is useful in async contexts for example where the data needs
|
||||
/// to be locked, but a mutex guard can not be held.
|
||||
///
|
||||
/// For an example see [`SharedData`].
|
||||
pub fn shared_data_locked(&self) -> SharedDataLocked<T> {
|
||||
|
||||
@@ -615,7 +615,8 @@ where
|
||||
&self.inner
|
||||
}
|
||||
|
||||
/// Reset to a specified pair of epochs, as if they were announced at blocks `parent_hash` and `hash`.
|
||||
/// Reset to a specified pair of epochs, as if they were announced at blocks `parent_hash` and
|
||||
/// `hash`.
|
||||
pub fn reset(&mut self, parent_hash: Hash, hash: Hash, number: Number, current: E, next: E) {
|
||||
self.inner = ForkTree::new();
|
||||
self.epochs.clear();
|
||||
|
||||
@@ -209,8 +209,9 @@ where
|
||||
{
|
||||
vec![<DigestItemFor<B> as CompatibleDigestItem>::babe_pre_digest(predigest)]
|
||||
} else {
|
||||
// well we couldn't claim a slot because this is an existing chain and we're not in the authorities.
|
||||
// we need to tell BabeBlockImport that the epoch has changed, and we put ourselves in the authorities.
|
||||
// well we couldn't claim a slot because this is an existing chain and we're not in the
|
||||
// authorities. we need to tell BabeBlockImport that the epoch has changed, and we put
|
||||
// ourselves in the authorities.
|
||||
let predigest =
|
||||
PreDigest::SecondaryPlain(SecondaryPlainPreDigest { slot, authority_index: 0_u32 });
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ pub struct ManualSealParams<B: BlockT, BI, E, C: ProvideRuntimeApi<B>, TP, SC, C
|
||||
/// Shared reference to the transaction pool.
|
||||
pub pool: Arc<TP>,
|
||||
|
||||
/// Stream<Item = EngineCommands>, Basically the receiving end of a channel for sending commands to
|
||||
/// the authorship task.
|
||||
/// Stream<Item = EngineCommands>, Basically the receiving end of a channel for sending
|
||||
/// commands to the authorship task.
|
||||
pub commands_stream: CS,
|
||||
|
||||
/// SelectChain strategy.
|
||||
@@ -281,7 +281,8 @@ mod tests {
|
||||
0,
|
||||
));
|
||||
let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None);
|
||||
// this test checks that blocks are created as soon as transactions are imported into the pool.
|
||||
// this test checks that blocks are created as soon as transactions are imported into the
|
||||
// pool.
|
||||
let (sender, receiver) = futures::channel::oneshot::channel();
|
||||
let mut sender = Arc::new(Some(sender));
|
||||
let commands_stream =
|
||||
@@ -350,7 +351,8 @@ mod tests {
|
||||
0,
|
||||
));
|
||||
let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None);
|
||||
// this test checks that blocks are created as soon as an engine command is sent over the stream.
|
||||
// this test checks that blocks are created as soon as an engine command is sent over the
|
||||
// stream.
|
||||
let (mut sink, commands_stream) = futures::channel::mpsc::channel(1024);
|
||||
let future = run_manual_seal(ManualSealParams {
|
||||
block_import: client.clone(),
|
||||
@@ -427,7 +429,8 @@ mod tests {
|
||||
0,
|
||||
));
|
||||
let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None);
|
||||
// this test checks that blocks are created as soon as an engine command is sent over the stream.
|
||||
// this test checks that blocks are created as soon as an engine command is sent over the
|
||||
// stream.
|
||||
let (mut sink, commands_stream) = futures::channel::mpsc::channel(1024);
|
||||
let future = run_manual_seal(ManualSealParams {
|
||||
block_import: client.clone(),
|
||||
|
||||
@@ -591,8 +591,8 @@ where
|
||||
return
|
||||
}
|
||||
|
||||
// The worker is locked for the duration of the whole proposing period. Within this period,
|
||||
// the mining target is outdated and useless anyway.
|
||||
// The worker is locked for the duration of the whole proposing period. Within this
|
||||
// period, the mining target is outdated and useless anyway.
|
||||
|
||||
let difficulty = match algorithm.difficulty(best_hash) {
|
||||
Ok(x) => x,
|
||||
|
||||
@@ -428,7 +428,8 @@ impl<B: BlockT, T: SimpleSlotWorker<B> + Send> SlotWorker<B, <T::Proposer as Pro
|
||||
|
||||
/// Slot specific extension that the inherent data provider needs to implement.
|
||||
pub trait InherentDataProviderExt {
|
||||
/// The current timestamp that will be found in the [`InherentData`](`sp_inherents::InherentData`).
|
||||
/// The current timestamp that will be found in the
|
||||
/// [`InherentData`](`sp_inherents::InherentData`).
|
||||
fn timestamp(&self) -> Timestamp;
|
||||
|
||||
/// The current slot that will be found in the [`InherentData`](`sp_inherents::InherentData`).
|
||||
@@ -1059,7 +1060,8 @@ mod test {
|
||||
})
|
||||
.collect();
|
||||
|
||||
// Should always be true after a short while, since the chain is advancing but finality is stalled
|
||||
// Should always be true after a short while, since the chain is advancing but finality is
|
||||
// stalled
|
||||
let expected: Vec<bool> = (slot_now..300).map(|s| s > 8).collect();
|
||||
assert_eq!(should_backoff, expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user