Fix test-rustdoc (#1266)

* Fix `test-rustdoc`

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

---------

Co-authored-by: command-bot <>
This commit is contained in:
Bastian Köcher
2023-08-29 21:23:38 +02:00
committed by GitHub
parent 430edd7535
commit 9acb06717e
30 changed files with 71 additions and 73 deletions
@@ -263,8 +263,8 @@ pub mod pallet {
Pallet::<T>::do_place_order(sender, max_amount, para_id, AllowDeath)
}
/// Same as the [`place_order_allow_death`] call , but with a check that placing the order
/// will not reap the account.
/// Same as the [`place_order_allow_death`](Self::place_order_allow_death) call , but with a
/// check that placing the order will not reap the account.
///
/// Parameters:
/// - `origin`: The sender of the call, funds will be withdrawn from this account.
@@ -94,8 +94,8 @@ pub struct HostConfiguration<BlockNumber> {
///
/// If PVF pre-checking is enabled this should be greater than the maximum number of blocks
/// PVF pre-checking can take. Intuitively, this number should be greater than the duration
/// specified by [`pvf_voting_ttl`]. Unlike, [`pvf_voting_ttl`], this parameter uses blocks
/// as a unit.
/// specified by [`pvf_voting_ttl`](Self::pvf_voting_ttl). Unlike,
/// [`pvf_voting_ttl`](Self::pvf_voting_ttl), this parameter uses blocks as a unit.
#[cfg_attr(feature = "std", serde(alias = "validation_upgrade_frequency"))]
pub validation_upgrade_cooldown: BlockNumber,
/// The delay, in blocks, after which an upgrade of the validation code is applied.
@@ -113,14 +113,15 @@ pub struct HostConfiguration<BlockNumber> {
/// been completed.
///
/// Note, there are situations in which `expected_at` in the past. For example, if
/// [`paras_availability_period`] is less than the delay set by
/// this field or if PVF pre-check took more time than the delay. In such cases, the upgrade is
/// further at the earliest possible time determined by [`minimum_validation_upgrade_delay`].
/// [`paras_availability_period`](Self::paras_availability_period) is less than the delay set
/// by this field or if PVF pre-check took more time than the delay. In such cases, the upgrade
/// is further at the earliest possible time determined by
/// [`minimum_validation_upgrade_delay`](Self::minimum_validation_upgrade_delay).
///
/// The rationale for this delay has to do with relay-chain reversions. In case there is an
/// invalid candidate produced with the new version of the code, then the relay-chain can
/// revert [`validation_upgrade_delay`] many blocks back and still find the new code in the
/// storage by hash.
/// revert [`validation_upgrade_delay`](Self::validation_upgrade_delay) many blocks back and
/// still find the new code in the storage by hash.
///
/// [#4601]: https://github.com/paritytech/polkadot/issues/4601
pub validation_upgrade_delay: BlockNumber,
@@ -229,7 +230,8 @@ pub struct HostConfiguration<BlockNumber> {
pub pvf_voting_ttl: SessionIndex,
/// The lower bound number of blocks an upgrade can be scheduled.
///
/// Typically, upgrade gets scheduled [`validation_upgrade_delay`] relay-chain blocks after
/// Typically, upgrade gets scheduled
/// [`validation_upgrade_delay`](Self::validation_upgrade_delay) relay-chain blocks after
/// the relay-parent of the parablock that signalled the validation code upgrade. However,
/// in the case a pre-checking voting was concluded in a longer duration the upgrade will be
/// scheduled to the next block.
@@ -240,7 +242,8 @@ pub struct HostConfiguration<BlockNumber> {
/// To prevent that, we introduce the minimum number of blocks after which the upgrade can be
/// scheduled. This number is controlled by this field.
///
/// This value should be greater than [`paras_availability_period`].
/// This value should be greater than
/// [`paras_availability_period`](Self::paras_availability_period).
pub minimum_validation_upgrade_delay: BlockNumber,
}
+3 -3
View File
@@ -81,9 +81,9 @@ impl From<QueueDownwardMessageError> for SendError {
}
}
/// An error returned by [`check_processed_downward_messages`] that indicates an acceptance check
/// didn't pass.
pub enum ProcessedDownwardMessagesAcceptanceErr {
/// An error returned by [`Pallet::check_processed_downward_messages`] that indicates an acceptance
/// check didn't pass.
pub(crate) enum ProcessedDownwardMessagesAcceptanceErr {
/// If there are pending messages then `processed_downward_messages` should be at least 1,
AdvancementRule,
/// `processed_downward_messages` should not be greater than the number of pending messages.
+5 -5
View File
@@ -149,17 +149,17 @@ pub struct HrmpChannel {
pub recipient_deposit: Balance,
}
/// An error returned by [`check_hrmp_watermark`] that indicates an acceptance criteria check
/// didn't pass.
pub enum HrmpWatermarkAcceptanceErr<BlockNumber> {
/// An error returned by [`Pallet::check_hrmp_watermark`] that indicates an acceptance criteria
/// check didn't pass.
pub(crate) enum HrmpWatermarkAcceptanceErr<BlockNumber> {
AdvancementRule { new_watermark: BlockNumber, last_watermark: BlockNumber },
AheadRelayParent { new_watermark: BlockNumber, relay_chain_parent_number: BlockNumber },
LandsOnBlockWithNoMessages { new_watermark: BlockNumber },
}
/// An error returned by [`check_outbound_hrmp`] that indicates an acceptance criteria check
/// An error returned by [`Pallet::check_outbound_hrmp`] that indicates an acceptance criteria check
/// didn't pass.
pub enum OutboundHrmpAcceptanceErr {
pub(crate) enum OutboundHrmpAcceptanceErr {
MoreMessagesThanPermitted { sent: u32, permitted: u32 },
NotSorted { idx: u32 },
NoSuchChannel { idx: u32, channel_id: HrmpChannelId },
@@ -416,10 +416,10 @@ enum AcceptanceCheckErr<BlockNumber> {
OutboundHrmp(hrmp::OutboundHrmpAcceptanceErr),
}
/// An error returned by [`check_upward_messages`] that indicates a violation of one of acceptance
/// criteria rules.
/// An error returned by [`Pallet::check_upward_messages`] that indicates a violation of one of
/// acceptance criteria rules.
#[cfg_attr(test, derive(PartialEq))]
pub enum UmpAcceptanceCheckErr {
pub(crate) enum UmpAcceptanceCheckErr {
/// The maximal number of messages that can be submitted in one batch was exceeded.
MoreMessagesThanPermitted { sent: u32, permitted: u32 },
/// The maximal size of a single message was exceeded.
-8
View File
@@ -63,8 +63,6 @@ pub trait FeeTracker {
}
/// Schedule a para to be initialized at the start of the next session with the given genesis data.
///
/// See [`paras::Pallet::schedule_para_initialize`] for more details.
pub fn schedule_para_initialize<T: paras::Config>(
id: ParaId,
genesis: paras::ParaGenesisArgs,
@@ -73,8 +71,6 @@ pub fn schedule_para_initialize<T: paras::Config>(
}
/// Schedule a para to be cleaned up at the start of the next session.
///
/// See [`paras::Pallet::schedule_para_cleanup`] for more details.
pub fn schedule_para_cleanup<T: paras::Config>(id: primitives::Id) -> Result<(), ()> {
<paras::Pallet<T>>::schedule_para_cleanup(id).map_err(|_| ())
}
@@ -90,8 +86,6 @@ pub fn schedule_parachain_downgrade<T: paras::Config>(id: ParaId) -> Result<(),
}
/// Schedules a validation code upgrade to a parachain with the given id.
///
/// This simply calls [`crate::paras::Pallet::schedule_code_upgrade_external`].
pub fn schedule_code_upgrade<T: paras::Config>(
id: ParaId,
new_code: ValidationCode,
@@ -100,8 +94,6 @@ pub fn schedule_code_upgrade<T: paras::Config>(
}
/// Sets the current parachain head with the given id.
///
/// This simply calls [`crate::paras::Pallet::set_current_head`].
pub fn set_current_head<T: paras::Config>(id: ParaId, new_head: HeadData) {
paras::Pallet::<T>::set_current_head(id, new_head)
}
@@ -40,7 +40,7 @@ impl<T> IndexedRetain<T> for Vec<T> {
}
/// Helper trait until `is_sorted_by` is stabilized.
/// TODO: https://github.com/rust-lang/rust/issues/53485
/// TODO: <https://github.com/rust-lang/rust/issues/53485>
pub trait IsSortedBy<T> {
fn is_sorted_by<F>(self, cmp: F) -> bool
where
@@ -345,7 +345,7 @@ pub fn on_chain_votes<T: paras_inherent::Config>() -> Option<ScrapedOnChainVotes
<paras_inherent::Pallet<T>>::on_chain_votes()
}
/// Submits an PVF pre-checking vote. See [`paras::Pallet::submit_pvf_check_statement`].
/// Submits an PVF pre-checking vote.
pub fn submit_pvf_check_statement<T: paras::Config>(
stmt: PvfCheckStatement,
signature: ValidatorSignature,
@@ -353,8 +353,7 @@ pub fn submit_pvf_check_statement<T: paras::Config>(
<paras::Pallet<T>>::submit_pvf_check_statement(stmt, signature)
}
/// Returns the list of all PVF code hashes that require pre-checking. See
/// [`paras::Pallet::pvfs_require_precheck`].
/// Returns the list of all PVF code hashes that require pre-checking.
pub fn pvfs_require_precheck<T: paras::Config>() -> Vec<ValidationCodeHash> {
<paras::Pallet<T>>::pvfs_require_precheck()
}