Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests for pallet EPM-MB #6332

Draft
wants to merge 12 commits into
base: gpestana/pallet-epm-mb
Choose a base branch
from
8 changes: 4 additions & 4 deletions substrate/frame/election-provider-multi-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
//! - pallet-unsigned
//! ```
//!
//! Each sub-pallet has a specific set of tasks and implement one or more interfaces to expose their
//! functionality to the core pallet:
//! Each sub-pallet has a specific set of tasks and implements one or more interfaces to expose
//! their functionality to the core pallet:
//! - The [`verifier`] pallet provides an implementation of the [`verifier::Verifier`] trait, which
//! exposes the functionality to verify NPoS solutions in a multi-block context. In addition, it
//! implements [`verifier::AsyncVerifier`] which verifies multi-paged solution asynchronously.
//! implements [`verifier::AsyncVerifier`] which verifies multi-paged solutions asynchronously.
//! - The [`signed`] pallet implements the signed phase, where off-chain entities commit to and
//! submit their election solutions. This pallet implements the
//! [`verifier::SolutionDataProvider`], which is used by the [`verifier`] pallet to fetch solution
Expand All @@ -62,7 +62,7 @@
//! ### Pallet ordering
//!
//! Due to the assumptions of when the `on_initialize` hook must be called by the executor for the
//! core pallet and each sub-pallets, it is crucial the the pallets are ordered correctly in the
//! core pallet and each sub-pallets, it is crucial that the pallets are ordered correctly in the
//! construct runtime. The ordering must be the following:
//!
//! ```text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub mod pallet {

/// Wrapper for signed submissions.
///
/// It handle 3 storage items:
/// It handles 3 storage items:
///
/// 1. [`SortedScores`]: A flat, striclty sorted, vector with all the submission's scores. The
/// vector contains a tuple of `submitter_id` and `claimed_score`.
Expand Down Expand Up @@ -571,7 +571,7 @@ pub mod pallet {
Submissions::<T>::scores_for(round).last().cloned()
}

/// Returns the metadata of a submitter for a given account.
/// Returns the metadata of a submitter for a given round.
pub(crate) fn metadata_for(
round: u32,
who: &T::AccountId,
Expand Down Expand Up @@ -718,7 +718,7 @@ pub mod pallet {
Ok(())
}

/// Force clean submissions storage for a given (`sumitter`, `round`) tuple.
/// Force clean submissions storage for a given (`submitter`, `round`) tuple.
///
/// This pallet expects that submitted pages for `round` may exist IFF a corresponding
/// metadata exists.
Expand Down Expand Up @@ -804,7 +804,7 @@ impl<T: Config> SolutionDataProvider for Pallet<T> {
})
}

/// Returns the score of the *best* solution in the queueu.
/// Returns the score of the *best* solution in the queue.
fn get_score() -> Option<ElectionScore> {
let round = crate::Pallet::<T>::current_round();
Submissions::<T>::leader(round).map(|(_who, score)| score)
Expand Down
Loading
Loading