pub struct Pallet<T>(PhantomData<T>);Expand description
Primary Marker type for the Chain Manager pallet.
This pallet provides implementations for traits from
blockchain, roles,
session, offences
Implemented traits:
Tuple Fields§
§0: PhantomData<T>Implementations§
Source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
Sourcepub fn validate(
origin: OriginFor<T>,
payload: ValidatePayloadOf<T>,
_signature: T::Signature,
) -> DispatchResult
pub fn validate( origin: OriginFor<T>, payload: ValidatePayloadOf<T>, _signature: T::Signature, ) -> DispatchResult
Register an author’s new affidavit signing key for the upcoming session’s participation as a validator.
This extrinsic allows an author to declare their off-chain signing key that will be used to sign affidavits for the next session’s election.
It ensures that only valid and available authors can register keys.
§Notes
- Affidavit Keys are session-specific and are updated each session.
- This extrinsic allows submission of affidavit for next session only.
- Affidavit Declaration/Submission will rotate keys once every submission for further sessions then.
§Errors
Returns a DispatchError if author-role authorization fails.
Sourcepub fn declare(
origin: OriginFor<T>,
payload: AffidavitPayloadOf<T>,
_signature: T::Signature,
) -> DispatchResult
pub fn declare( origin: OriginFor<T>, payload: AffidavitPayloadOf<T>, _signature: T::Signature, ) -> DispatchResult
Submit an affidavit for the upcoming session election.
This extrinsic allows an author to declare their election weights (affidavit) for the next session. It also rotates the author’s signing key for the subsequent affidavit.
§Parameters
origin: Must be a signed account corresponding to the author submitting the affidavit.payload: The payload that was signed off-chain representing the affidavit data.signature: The author’s signature of the payload, used for verification.new_key: A new affidavit signing key to replace the current one for the next upcoming session.
§Notes
- Affidavit submissions are session-specific.
- Key rotation ensures authors maintain fresh signing keys for security.
- Only validated and available authors can submit affidavits.
§Errors
Returns a DispatchError if un-privileged to submit an affidavit.
Sourcepub fn elect(
origin: OriginFor<T>,
payload: ElectionPayloadOf<T>,
_signature: T::Signature,
) -> DispatchResult
pub fn elect( origin: OriginFor<T>, payload: ElectionPayloadOf<T>, _signature: T::Signature, ) -> DispatchResult
Execute the election for the upcoming session.
This extrinsic allows an author to act as the election runner for the election session (next-session). It verifies the author’s affidavit-based signature, prepares the election using all submitted affidavits, and records the runner for audit and reward attribution.
Since this is an unsigned extrinsic, it is constructed and submitted by validator offchain workers (OCWs).
Although unsigned, it is treated as a pseudo-inherent:
- It is authorized via affidavit signature verification
- It may carry rewards for successfully running the election
- It is expected to be submitted locally by validators rather than propagated by external transaction authors
§Errors
Returns a DispatchError if election execution or authorization fails.
Sourcepub fn chill(
origin: OriginFor<T>,
affidavit_pub: AffidavitId<T>,
) -> DispatchResult
pub fn chill( origin: OriginFor<T>, affidavit_pub: AffidavitId<T>, ) -> DispatchResult
Request to step back or “chill” immediately from election participation by erasing affidavit keys.
This safely avoids penalties by pausing an author’s duties.
This extrinsic allows an author to withdraw from participating in upcoming elections or prevent submitting future affidavits. The actual effect depends on the current block relative to the affidavit submissions and election windows.
Note that its always advised to chill validation before resign author role
to skip unnecessary invalid affidavit declarations.
§Parameters
origin: Must be a signed account corresponding to the author i.e., controller/role account.affidavit_pub: Public affidavit key registered for a new session’s affidavit submission.
§Notes
- Removing affidavit keys ensures authors cannot unfairly influence future elections.
- By inspecting returned errors, callers can compute the optimal chill window.
§Errors
Returns a DispatchError with diagnostic in case of irrevocable
duties assigned.
Sourcepub fn force_genesis_config(
origin: OriginFor<T>,
field: ForceGenesisConfig<T>,
) -> DispatchResult
pub fn force_genesis_config( origin: OriginFor<T>, field: ForceGenesisConfig<T>, ) -> DispatchResult
Force-update a selected genesis configuration parameter.
Origin: Root only.
This extrinsic allows privileged modification of runtime parameters that were originally defined at genesis.
AllowAffidavits- Enables or disables affidavit submission.AffidavitBeginsAt- Updates the start of the affidavit submission window.AffidavitEndsAt- Updates the end of the affidavit submission window.ElectionBeginsAt- Updates when election execution begins within the session.ElectionRunnerPointsUpgrade- Updates the reward points for election runners.ValidateTxPriority- Updates the priority for validation-related extrinsics.ElectionTxPriority- Updates the priority for election execution extrinsics.AffidavitTxPriority- Updates the priority for affidavit submission extrinsics.FinalityAfter- Updates the time-based delay before operations are considered final.FinalityTicks- Updates the block-based confirmation threshold for finality.
The call enforces consistency constraints where applicable:
- Affidavit window ordering:
AffidavitBeginsAt < AffidavitEndsAtAffidavitEndsAt > AffidavitBeginsAt
- The following values must be non-zero:
- transaction priorities
- finality thresholds (
FinalityAfter,FinalityTicks)
This call directly overwrites storage and emits an event containing the updated configuration variant.
Source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
Sourcepub fn can_chill(
author: AuthorOf<T>,
affidavit_pub: AffidavitId<T>,
) -> DispatchResult
pub fn can_chill( author: AuthorOf<T>, affidavit_pub: AffidavitId<T>, ) -> DispatchResult
Returns Ok(()) if the author is permitted to submit the Self::chill extrinsic
using the given affidavit key.
Performs a read-only pre-check verifying that chilling does not conflict with any active or pending duty. The check branches on which session scope the key belongs to:
-
Next affidavit session (current + 2): author has already declared and rotated. Chilling is allowed only after the election window closes and the author is not in the revealed elected set.
-
Next session (current + 1): author has registered but may not have declared yet. Chilling is allowed before the affidavit window or after it closes without a declaration. Rejected if a declaration exists but the key is stale relative to the expected post-rotation key.
§Parameters
author: The author requesting to chill.affidavit_pub: The affidavit key registered viaSelf::validateor rotated duringSelf::declare.
§Returns
Ok(())if chilling is permitted.Err(ValidatorCannotChill)if the author is active in the current session.Err(CandidateCannotChill)if the election window is still open.Err(ElectedCannotChill)if the author appears in the revealed elected set.Err(InvalidRotatedAffidavitKey)if a declaration exists but the key is stale.Err(DispatchError)for ownership, timing, or configuration violations.
Sourcepub fn can_validate(author: AuthorOf<T>) -> DispatchResult
pub fn can_validate(author: AuthorOf<T>) -> DispatchResult
Returns Ok(()) if the author is eligible to submit a Self::validate extrinsic.
Performs a pre-check for validation readiness by verifying that:
- the author is not already an active validator in the current session,
- the author exists in the role system via
Config::RoleAdapter, and - the author is currently marked as available.
Intended for use by offchain workers and RPC consumers before constructing
and submitting a Self::validate extrinsic.
§Parameters
author: The author whose validation eligibility is being checked.
§Returns
Ok(())if all conditions for validation readiness are satisfied.Err(ActivelyValidating)if the author is already in the active validator set.Err(DispatchError)if the role check or availability check fails.
Sourcepub fn is_validating(author: AuthorOf<T>) -> bool
pub fn is_validating(author: AuthorOf<T>) -> bool
Returns true if the author is an active validator in the current session.
Converts the author identifier into its session-specific validator id using
the configured [Convert] implementation, then checks whether that validator
appears in the current session’s active validator set via [pallet_session].
Returns false if the author-to-validator conversion fails, as the runtime
cannot determine validator status without a valid session identity.
§Parameters
author: The author whose active validation status is being checked.
Sourcepub fn is_chilling(author: AuthorOf<T>) -> bool
pub fn is_chilling(author: AuthorOf<T>) -> bool
Returns true if the author has no registered affidavit key in any
relevant future session scope and is therefore in a chilled state.
This is the logical inverse of Self::is_pursuing and delegates
directly to Self::get_runtime_afdt_key.
§Parameters
author: The author whose chilling status is being checked.
Sourcepub fn get_runtime_afdt_key(
author: AuthorOf<T>,
) -> Result<(SessionIndex, AffidavitId<T>), DispatchError>
pub fn get_runtime_afdt_key( author: AuthorOf<T>, ) -> Result<(SessionIndex, AffidavitId<T>), DispatchError>
Retrieve the author’s registered affidavit key and its associated session from the two relevant future session scopes.
Searches across:
- the next affidavit session (current + 2), checked first, and
- the next session (current + 1), checked second.
The next affidavit session is checked first because a key stored there indicates a more advanced lifecycle state: the author has already declared an affidavit for the next session and rotated to a fresh key for the session after.
§Parameters
author: The author whose registered affidavit key is being retrieved.
§Returns
Ok((session, affidavit_key))if a key owned by the author is found in either future session scope.Err(AffidavitKeyPairNotFound)if no registered key exists for the author.
Sourcepub fn get_public_key(
afdt_key: AffidavitId<T>,
) -> Result<T::Public, DispatchError>
pub fn get_public_key( afdt_key: AffidavitId<T>, ) -> Result<T::Public, DispatchError>
Resolve an affidavit account identifier to its corresponding public key in the node-local keystore.
Iterates all locally available affidavit application keys, derives the
account-form identifier for each, and returns the public key whose derived
account matches the provided afdt_key.
§Parameters
afdt_key: The affidavit account identifier to resolve.
§Returns
Ok(public_key)if a matching key is found in the local keystore.Err(AfdtPublicKeyNotFound)if no locally held key derives to the given identifier.
§Note
This function reads from the node-local keystore and may return different results across nodes depending on which keys each node holds.
Sourcepub fn get_finalized_afdt_key() -> Result<AffidavitId<T>, DispatchError>
pub fn get_finalized_afdt_key() -> Result<AffidavitId<T>, DispatchError>
Retrieve the currently finalized active affidavit key from node-local offchain storage.
Reads the active affidavit key using finalized offchain storage semantics
and returns it only when its confidence level is Confidence::Safe.
Keys that exist but have not yet reached safe confidence are rejected,
as they may still be subject to re-org.
§Returns
Ok(key)if a finalized key exists and is marked asConfidence::Safe.Err(ActiveAfdtKeyFinalizedHangingValue)if a finalized value exists without a corresponding fork-aware reference.Err(ActiveAfdtKeyNotYetFinalized)if the key exists but has not yet reached safe confidence.Err(DispatchError)if the offchain storage read itself fails.
§Note
This value is maintained in node-local offchain storage and is not part of on-chain state. Results may differ across nodes.
Sourcepub fn sign_validate_payload() -> Result<(ValidatePayloadOf<T>, T::Signature), DispatchError>
pub fn sign_validate_payload() -> Result<(ValidatePayloadOf<T>, T::Signature), DispatchError>
Construct and sign a ValidatePayload using the currently finalized
active affidavit key from node-local offchain storage.
Performs the following steps in sequence:
- retrieves the finalized active affidavit key via
Self::get_finalized_afdt_key, - resolves that key to a local public key via
Self::get_public_key, - constructs a
ValidatePayloadwrapping the resolved public key, and - signs the payload using the configured
Config::AffidavitCryptoscheme.
The resulting payload and signature are the exact inputs required by
the Self::validate extrinsic.
§Returns
Ok((payload, signature))if the key is finalized, locally available, and signing succeeds.Err(CannotSignValidateTxPayload)if signing fails.Err(DispatchError)if key retrieval or resolution fails.
§Note
This function reads from node-local offchain storage and the local keystore. Results are node-specific and may differ across validators.
Sourcepub fn get_elects() -> Result<ElectionElects<T>, DispatchError>
pub fn get_elects() -> Result<ElectionElects<T>, DispatchError>
Retrieve the currently revealed elected author set from the election manager.
Delegates to ElectAuthors::reveal and returns the result as a
concrete ElectionElects value.
This function does not trigger or re-run an election. It only reads the result of the most recently completed election preparation. If no election has been executed or the result is unavailable, it returns an error.
§Returns
Ok(ElectionElects)containing the elected author set.Err(UnableToRevealElected)if no election result is currently available.
Sourcepub fn fetch_affidavit(
afdt_id: AffidavitId<T>,
) -> Result<ElectionVia<T>, DispatchError>
pub fn fetch_affidavit( afdt_id: AffidavitId<T>, ) -> Result<ElectionVia<T>, DispatchError>
Retrieve the submitted affidavit for a given affidavit identifier targeting the upcoming session’s election.
Resolves the affidavit key to its owning author, then returns the author’s declared election weights for the next session (current + 1).
§Parameters
afdt_id: The affidavit key identifier to look up.
§Returns
Ok(ElectionVia)containing the author’s declared election weights.Err(DispatchError)otherwise.
Sourcepub fn fetch_affidavit_for(
afdt_id: AffidavitId<T>,
session: SessionIndex,
) -> Result<ElectionVia<T>, DispatchError>
pub fn fetch_affidavit_for( afdt_id: AffidavitId<T>, session: SessionIndex, ) -> Result<ElectionVia<T>, DispatchError>
Retrieve the submitted affidavit for a given affidavit identifier targeting a specific session.
Unlike Self::fetch_affidavit, which always targets the upcoming session,
this function allows querying affidavits for any session by index.
It resolves the affidavit key to its registered author for the given session,
then returns that author’s declared election weights.
§Parameters
afdt_id: The affidavit key identifier to look up.session: The session index for which the affidavit is queried.
§Returns
Ok(ElectionVia)containing the author’s declared election weights for the session.Err(AffidavitKeyPairNotFound)if the key is not registered for the given session.Err(AffidavitNotFound)if the author has not submitted an affidavit for that session.
Sourcepub fn is_contesting(author: AuthorOf<T>) -> bool
pub fn is_contesting(author: AuthorOf<T>) -> bool
Returns true if the author has submitted an affidavit and is
actively contesting the upcoming session’s election.
An author is considered contesting when a valid affidavit entry exists in storage for the next session (current + 1). This indicates that the author has declared election weights and is a candidate for selection.
§Parameters
author: The author whose election candidacy is being checked.
§Returns
trueif the author has a stored affidavit for the upcoming session.falseotherwise, including when the author has never submitted an affidavit or has withdrawn.
Sourcepub fn is_pursuing(author: AuthorOf<T>) -> bool
pub fn is_pursuing(author: AuthorOf<T>) -> bool
Returns true if the author is actively pursuing validation
by maintaining a registered affidavit key for a future session.
An author is considered pursuing when they have a registered affidavit key in either the next session or the next affidavit session scope, meaning they have not chilled and intend to participate in upcoming elections.
This is the logical inverse of Self::is_chilling.
§Parameters
author: The author whose pursuit status is being checked.
§Returns
trueif the author holds an affidavit key for any relevant future session.falseif the author has no registered keys and is effectively chilled.
Sourcepub fn can_declare(afdt_id: AffidavitId<T>) -> DispatchResult
pub fn can_declare(afdt_id: AffidavitId<T>) -> DispatchResult
Returns Ok(()) if the author identified by the given affidavit key
is eligible to submit an affidavit declaration for the upcoming session.
This function performs a full pre-check for the Self::declare extrinsic,
verifying that:
- the affidavit key is registered for the upcoming session,
- the global
AllowAffidavitsflag is enabled, - the author associated with the key is available in the role system, and
- the current block falls within the configured affidavit submission window.
Intended for use by offchain workers and RPC consumers to determine whether an affidavit declaration can be safely submitted at the current block.
§Parameters
afdt_id: The affidavit key identifier to evaluate.
§Returns
Ok(())if all conditions for affidavit submission are satisfied.Err(DispatchError)otherwise.
Sourcepub fn can_elect(author: AuthorOf<T>) -> DispatchResult
pub fn can_elect(author: AuthorOf<T>) -> DispatchResult
Returns Ok(()) if the given author is eligible to submit an election
extrinsic at the current block.
This function performs a full pre-check for the Self::elect extrinsic,
verifying that:
- the current block has an identifiable block author,
- the provided author matches the current block author, and
- the current block falls within the configured election window.
Only the block author may run the election for a given block, ensuring that election submissions cannot be spoofed by non-producing validators.
§Parameters
author: The author asserting eligibility to run the election.
§Returns
Ok(())if the author is the current block author and the election window is open.Err(DispatchError)otherwise.
Sourcepub fn compute_affidavit_window() -> Result<AffidavitWindow<T>, DispatchError>
pub fn compute_affidavit_window() -> Result<AffidavitWindow<T>, DispatchError>
Computes the affidavit submission window for the current session.
The window is derived from the session start and average session length:
start = session_start + (affidavit_begins_at * avg_session_length)
end = session_start + (affidavit_ends_at * avg_session_length)Note: affidavit_begins_at and affidavit_ends_at are percentages
of the session length and are applied to compute block offsets.
§Returns
Ok(AffidavitWindow)containing start and end blocksDispatchErrorotherwise
§Notes
- The resulting window is session-relative and recalculated each session.
- Affidavits submitted outside this window should be rejected.
Sourcepub fn compute_election_window() -> Result<ElectionWindow<T>, DispatchError>
pub fn compute_election_window() -> Result<ElectionWindow<T>, DispatchError>
Computes the election window for the current session.
The election window is a sub-range of the affidavit window:
start = affidavit_start + (election_begins_at * (affidavit_end - affidavit_start))
end = affidavit_endNote:
election_begins_atis a percentage of the affidavit window range.- The election always ends when the affidavit window ends.
§Diagram
|--------- Affidavit Window ---------|
|------|-----------------------------|
^ ^
election_start election_end (= affidavit_end)§Returns
Ok(ElectionWindow)containing start and end blocksDispatchErrorotherwise
Trait Implementations§
Source§impl<T: Config> AuthorPoints<<T as Config>::AccountId, <T as Config>::Points> for Pallet<T>
Implementation of the AuthorPoints trait for the pallet.
impl<T: Config> AuthorPoints<<T as Config>::AccountId, <T as Config>::Points> for Pallet<T>
Implementation of the AuthorPoints trait for the pallet.
This implementation provides a session-scoped accounting layer for tracking and querying abstract points accumulated by authors during active validation.
Points represent good behaviour signals, specifically block production contributions, and serve as inputs to downstream reward and incentive mechanisms. They are not assets themselves and carry no immediate economic value.
§Design Notes
- Points are scoped per session and never aggregated across sessions.
- Accumulation is monotonic within a session.
- Each point corresponds to a unit of block production activity.
- Points are intentionally retained after session end for:
- Auditability
- Historical analysis
- Deterministic reward calculation
- This layer is deterministic and side-effect minimal.
§Implementation Notes
- This implementation does not perform reward distribution.
- Economic interpretation of points is delegated to
RewardAuthors. - Clearing of points is intentionally unsupported at this layer.
Source§fn points_of(author: &AuthorOf<T>) -> Result<T::Points, DispatchError>
fn points_of(author: &AuthorOf<T>) -> Result<T::Points, DispatchError>
Returns the total accumulated points for an author in the current session.
§Semantics
- Points are accumulated incrementally during the session.
- Each point reflects a block production contribution.
- Calling this function mid-session returns a partial total.
- Calling this function at session end yields the final value used for reward calculation.
§Errors
- Returns
DispatchErrorif the author has not accumulated any points in the current session.
Source§fn clear_points()
fn clear_points()
No-op method for clearing accumulated points.
Point data is retained indefinitely to:
- Preserve full historical traceability
- Support deterministic audits
- Avoid accidental data loss before reward finalization
Any future clearing, pruning, or archival must be performed via explicit governance or maintenance extrinsics.
Source§fn set_points(author: &AuthorOf<T>, points: T::Points) -> DispatchResult
fn set_points(author: &AuthorOf<T>, points: T::Points) -> DispatchResult
Sets the points for an author in the current session.
§Semantics
- Overwrites the existing points value for the author.
- Acts as the primitive storage write for point updates.
§Notes
- Typically used internally by higher-level operations such as
Self::add_point.
Source§fn iter_points() -> impl Iterator<Item = (AuthorOf<T>, T::Points)>
fn iter_points() -> impl Iterator<Item = (AuthorOf<T>, T::Points)>
Returns an iterator over all authors and their accumulated points for the current session.
§Semantics
- Provides a complete view of the session-scoped points state.
- Includes all authors who have accumulated at least one point.
- The iterator reflects the current state and may change as new points are added during the session.
§Usage
- Intended for runtime operations such as:
- Reward computation
- Ranking or selection
- Performance evaluation
§Notes
- Any clearing, pruning, or archival is the responsibility of external logic (e.g., governance or maintenance extrinsics).
Source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T: Config> Convert<<T as Config>::AccountId, Option<<T as Config>::ValidatorId>> for Pallet<T>
impl<T: Config> Convert<<T as Config>::AccountId, Option<<T as Config>::ValidatorId>> for Pallet<T>
Source§impl<T: Config> ElectionAffidavits<<T as Config>::AccountId, <<T as Config>::ElectionAdapter as ElectionManager<<T as Config>::AccountId>>::ElectionWeightOf> for Pallet<T>
Implementation of the ElectionAffidavits trait for the pallet.
impl<T: Config> ElectionAffidavits<<T as Config>::AccountId, <<T as Config>::ElectionAdapter as ElectionManager<<T as Config>::AccountId>>::ElectionWeightOf> for Pallet<T>
Implementation of the ElectionAffidavits trait for the pallet.
This implementation bridges the generic ElectionAffidavits abstraction
with the pallet’s internal affidavit registry (AuthorAffidavits &
AffidavitKeys), enabling authors to self-report their election weights
for upcoming sessions.
§Design Notes
- Affidavit submission is only allowed when
AllowAffidavitsis enabled. - Affidavits are stored per session, not globally, ensuring clean rotation.
- Time gating is enforced through
AffidavitBeginsAtandAffidavitEndsAt, relative to average session length. - Affidavit data is immutable within its session once the submission period ends.
- All operations must remain audit-safe and deterministic.
§Implementation Notes
This bridge layer does not perform any ranking, scoring, or weighting logic.
Those responsibilities remain with the ElectAuthors and ElectionManager
implementations. The affidavit simply represents a candidate’s declaration
of intent and associated metrics for the next election round.
Source§fn can_submit_affidavit(who: &AffidavitId<T>) -> DispatchResult
fn can_submit_affidavit(who: &AffidavitId<T>) -> DispatchResult
Checks whether an author can submit an affidavit for the upcoming session-election.
- The global
AllowAffidavitsflag is enabled. - The current block is within the configured affidavit submission window.
DispatchError otherwise
Source§fn submit_affidavit(
who: &AffidavitId<T>,
affidavit: &ElectionVia<T>,
) -> DispatchResult
fn submit_affidavit( who: &AffidavitId<T>, affidavit: &ElectionVia<T>, ) -> DispatchResult
Submits a new affidavit for the next session.
Directly inserts the affidavit into storage for the upcoming session.
§Details
- Persists the affidavit under the next session’s affidavits mapping.
- Overwrites any previously submitted affidavit for the same session.
- Each author can maintain only one recent affidavit per future session.
Source§fn gen_affidavit(who: &AffidavitId<T>) -> Result<ElectionVia<T>, DispatchError>
fn gen_affidavit(who: &AffidavitId<T>) -> Result<ElectionVia<T>, DispatchError>
Generates an affidavit dynamically for the given author’s affidavit ID.
§Overview
- Inspects abstract weight via
InspectWeightfromConfig::ElectionAdapter. - Produces an
ElectionViastructure that represents the author’s self-declared election weights.
§Returns
Ok(ElectionVia)on success.- DispatchError otherwise
Source§fn remove_affidavit(who: &AffidavitId<T>) -> DispatchResult
fn remove_affidavit(who: &AffidavitId<T>) -> DispatchResult
Source§fn get_affidavit(who: &AffidavitId<T>) -> Result<ElectionVia<T>, DispatchError>
fn get_affidavit(who: &AffidavitId<T>) -> Result<ElectionVia<T>, DispatchError>
Retrieves an affidavit for the given author for the next session’s election.
§Returns
- The
ElectionViastructure associated with the author. - DispatchError if no affidavit is stored for the next session election.
Source§fn affidavit_exists(who: &AffidavitId<T>) -> DispatchResult
fn affidavit_exists(who: &AffidavitId<T>) -> DispatchResult
Checks if an affidavit exists for the given author for the upcoming election.
§Returns
Ok(())if the affidavit exists.- DispatchError otherwise.
Source§fn clear_affidavits()
fn clear_affidavits()
No-op method.
This low-level implementation is intentionally left empty.
Affidavit clearing is deferred to higher-level logic to:
- Preserve full historical traceability.
- Prevent accidental data loss before election finalization.
§Notes
- The pallet should query affidavits per session only once.
- Re-querying beyond this point can cause election inconsistencies.
- Reserved for potential audit or archival extensions.
Source§fn on_submit_affidavit(who: &AffidavitId<T>, _affidavit: &ElectionVia<T>)
fn on_submit_affidavit(who: &AffidavitId<T>, _affidavit: &ElectionVia<T>)
Hook invoked after a successful affidavit submission.
This hook emits the AffidavitSubmitted event, reflecting
the submitted election weight for the author.
Source§impl<T: Config> ForksHandler<T, ForkLocalDepot> for Pallet<T>
Implements the fork graph management for this pallet’s offchain worker.
impl<T: Config> ForksHandler<T, ForkLocalDepot> for Pallet<T>
Implements the fork graph management for this pallet’s offchain worker.
Binds the pallet to the ForksHandler trait using ForkLocalDepot
as the scope type, wiring fork graph constants and error variants defined
in Config and Error into the fork resolution and recovery logic.
This impl is the prerequisite for calling ForksHandler::start inside
Hooks::offchain_worker,
which resolves the current fork branch before any routine executes.
Source§const TAG: &[u8] = b"pallet_chain_manager"
const TAG: &[u8] = b"pallet_chain_manager"
Source§const MAX_FORKS: u32 = T::MAX_FORKS
const MAX_FORKS: u32 = T::MAX_FORKS
Source§const MAX_RECOVER_TRAVERSAL: u32 = T::MAX_FORK_RECOVERY_TRAVERSAL
const MAX_RECOVER_TRAVERSAL: u32 = T::MAX_FORK_RECOVERY_TRAVERSAL
Source§fn max_forks_error() -> DispatchError
fn max_forks_error() -> DispatchError
Self::MAX_FORKS.Source§fn forks_not_enabled() -> DispatchError
fn forks_not_enabled() -> DispatchError
ForksHandler::start has initialized the fork graph.Source§fn inconsistent_forks() -> DispatchError
fn inconsistent_forks() -> DispatchError
Source§fn start<F>(
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
ocw: F,
)where
F: FnOnce(),
fn start<F>(
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
ocw: F,
)where
F: FnOnce(),
Source§fn get_head() -> Option<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>
fn get_head() -> Option<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>
Source§fn get_branch_hash(hash: <T as Config>::Hash) -> Option<[u8; 32]>
fn get_branch_hash(hash: <T as Config>::Hash) -> Option<[u8; 32]>
Source§fn get_block_branch(hash: <T as Config>::Hash) -> Option<Branch<T, S>>
fn get_block_branch(hash: <T as Config>::Hash) -> Option<Branch<T, S>>
Source§fn get_branch(branch_hash: &[u8]) -> Option<Branch<T, S>>
fn get_branch(branch_hash: &[u8]) -> Option<Branch<T, S>>
Source§fn get_prev_branch(hash: <T as Config>::Hash) -> Option<Branch<T, S>>
fn get_prev_branch(hash: <T as Config>::Hash) -> Option<Branch<T, S>>
fn get_prev_block_branch() -> Option<Branch<T, S>>
Source§fn get_divider(hash: <T as Config>::Hash) -> Option<[u8; 32]>
fn get_divider(hash: <T as Config>::Hash) -> Option<[u8; 32]>
Source§fn transition(branch: &Branch<T, S>, action: ForkAction) -> Option<Branch<T, S>>
fn transition(branch: &Branch<T, S>, action: ForkAction) -> Option<Branch<T, S>>
Source§fn gen_scope_item_key(item: &<S as Accrete>::Item) -> [u8; 32]
fn gen_scope_item_key(item: &<S as Accrete>::Item) -> [u8; 32]
Source§fn scope_item_exists(
key: &[u8; 32],
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<bool, Self::Logger>
fn scope_item_exists( key: &[u8; 32], target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<bool, Self::Logger>
true if the given scope key exists in the current fork’s branch. Read moreSource§fn add_to_scope(
item: <S as Accrete>::Item,
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<[u8; 32], Self::Logger>
fn add_to_scope( item: <S as Accrete>::Item, target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<[u8; 32], Self::Logger>
Source§fn remove_from_scope(
key: &[u8; 32],
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<(), Self::Logger>
fn remove_from_scope( key: &[u8; 32], target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<(), Self::Logger>
Source§fn inherited_branch_mutation_conflict(
block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<(), Self::Logger>
fn inherited_branch_mutation_conflict( block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<(), Self::Logger>
Source§fn inherited_branch_decode_error(
block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<(), Self::Logger>
fn inherited_branch_decode_error( block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<(), Self::Logger>
Source§fn max_forks(
block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
target: Option<&str>,
fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>,
) -> Result<(), Self::Logger>
fn max_forks( block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, target: Option<&str>, fmt: Option<fn(<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, &Self::Level, &str, &str) -> String>, ) -> Result<(), Self::Logger>
Source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
Source§type InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
Source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version attribute, or
[NoStorageVersionSet] if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version and will be removed after March 2024.Self::current_storage_version] instead. Read moreSource§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§fn offchain_worker(block: BlockNumberFor<T>)
fn offchain_worker(block: BlockNumberFor<T>)
Offchain Worker entry point coordinating affidavit lifecycle and elections.
This function acts as a deterministic orchestrator for a sequence of
structured offchain routines, executed once per block in best-effort mode.
It does not implement business logic itself; instead, it delegates all
responsibility to well-defined Routines and RoutineOf abstractions.
§Execution Model
All routines execute inside ForksHandler::start, which resolves and
persists the current fork graph branch before any routine runs.
Each routine calls Routines::run_service directly, followed by
Routines::on_ran_service on success. The routines are executed
imperatively and sequentially with fail-fast semantics:
- Initialize the node-local active affidavit key (if required).
- Attempt to run the election early (if the election window permits).
- Declare an affidavit for the upcoming session (if eligible).
- Rotate affidavit keys for the next session.
If any routine fails, execution stops immediately for the current block. All failures are already logged by the routine itself; the OCW hook performs no retries, compensation, or error interpretation.
§Semantics & Guarantees
- Best-effort execution: no transactional rollback is assumed.
- Idempotent by design: repeated execution across blocks or forks is safe.
- Authorization-aware: each routine explicitly determines its authorized
signer via
RoutineOf::whobefore execution. - Fork-safe: correctness is preserved across re-orgs through
fork-aware (
frame_suite::ForkAware) and finalized (frame_suite::Finalized) offchain storage semantics.
§Notes
- This function intentionally returns early on failure.
- All observability is provided via structured logging inside routines.
- Progress is achieved through repeated OCW invocations over time.
Source§fn on_initialize(_block: BlockNumberFor<T>) -> Weight
fn on_initialize(_block: BlockNumberFor<T>) -> Weight
Called at the beginning of each block.
Awards block production points to the current block author.
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive pallet. Read more§fn integrity_test()
fn integrity_test()
Source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
Source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test].Source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
Source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize].Source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
Source§fn on_genesis()
fn on_genesis()
Source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize].Source§impl<T: Config> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), Weight> for Pallet<T>
Integration with Substrate’s offence reporting system.
impl<T: Config> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), Weight> for Pallet<T>
Integration with Substrate’s offence reporting system.
This implementation bridges Substrate’s session-level offence detection
with the pallet’s author-level penalty scheduling via the
PenalizeAuthors interface.
Offences reported by the session pallet are translated into author identifiers and penalty inputs, which are then scheduled for enforcement by the pallet’s penalty subsystem.
Source§fn on_offence(
offenders: &[OffenceDetails<OffenceReporter<T>, Offender<T>>],
slash_fractions: &[PenaltyRatio],
_session: SessionIndex,
) -> Weight
fn on_offence( offenders: &[OffenceDetails<OffenceReporter<T>, Offender<T>>], slash_fractions: &[PenaltyRatio], _session: SessionIndex, ) -> Weight
Handles reported offences for the current session.
§Workflow
- Convert session-level offenders into local author identifiers.
- Map each offence to its corresponding penalty fraction.
- Schedule penalties via the pallet’s penalty subsystem
PenalizeAuthors::penalize_authors.
§Semantics
- Penalties are scheduled, not enforced immediately.
- Final enforcement timing and transformation (e.g. scaling, caps,
aggregation) are governed by the configured penalty plugin model
Config::PenaltyModel. - This handler performs no additional offence validation beyond the guarantees already provided by Substrate.
Source§impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
Source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade].Source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T: Config> RoleActivity<<T as Config>::AccountId, <<T as Config>::RoleAdapter as RoleManager<<T as Config>::AccountId>>::TimeStamp> for Pallet<T>
Implementation of the RoleActivity trait for authors.
impl<T: Config> RoleActivity<<T as Config>::AccountId, <<T as Config>::RoleAdapter as RoleManager<<T as Config>::AccountId>>::TimeStamp> for Pallet<T>
Implementation of the RoleActivity trait for authors.
This implementation determines whether an author is currently idle / active or blocked by an active protocol duty.
§Design Notes
- Activity is computed dynamically on each invocation.
- No state is cached or persisted.
- Time gating is derived from session timing and affidavit windows.
§Caller Responsibility
- Callers must handle the returned
AuthorActivityand propagate its associated [DispatchError] to the user for exit solutions.
Source§type Activity = AuthorActivity<T>
type Activity = AuthorActivity<T>
Represents the duty, the author is currently performing.
Source§impl<T: Config> SessionManager<<T as Config>::AccountId> for Pallet<T>
Implementation of [SessionManager] for the pallet.
impl<T: Config> SessionManager<<T as Config>::AccountId> for Pallet<T>
Implementation of [SessionManager] for the pallet.
This implementation integrates author election, reward settlement, and session boundary tracking into Substrate’s session lifecycle.
It acts as the coordination layer between:
- Election resolution (
ElectAuthors) - Reward scheduling (
RewardAuthors) - Session metadata management (
CurrentSession,SessionStartAt)
§Design Notes
- Elections always target the next session.
- Rewards are settled for the ending session.
- Session state is updated deterministically at boundaries.
- No election logic or reward computation is performed here.
§Implementation Notes
- This implementation assumes election results are already finalized
before
new_sessionis invoked. - All side effects are session-boundary safe and audit-friendly.
Source§fn new_session(new_index: SessionIndex) -> Option<Vec<AuthorOf<T>>>
fn new_session(new_index: SessionIndex) -> Option<Vec<AuthorOf<T>>>
Prepares the author set for the upcoming session.
§Workflow
- Reveal elected authors via
ElectAuthors::reveal. - Reward the election runner with additional block points for the previous session.
§Semantics
- Returns
Noneif:- No election was executed, or
- The elected author set is empty.
- Election runner rewards are credited to the session
that is ending (
new_index - 1).
Source§fn end_session(_end_index: SessionIndex)
fn end_session(_end_index: SessionIndex)
Finalizes the ending session.
§Workflow
- Schedule rewards for authors based on accumulated points.
- Apply any pending configuration upgrades related to election runner incentives.
§Notes
- Reward scheduling is deferred; no immediate transfers occur.
- Configuration upgrades take effect atomically at session end.
Source§fn start_session(start_index: SessionIndex)
fn start_session(start_index: SessionIndex)
Source§impl<T: Config> ValidateUnsigned for Pallet<T>
impl<T: Config> ValidateUnsigned for Pallet<T>
Source§fn validate_unsigned(
_source: TransactionSource,
call: &Self::Call,
) -> TransactionValidity
fn validate_unsigned( _source: TransactionSource, call: &Self::Call, ) -> TransactionValidity
§fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
Source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey> indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.impl<T> Eq for Pallet<T>
Auto Trait Implementations§
impl<T> Freeze for Pallet<T>
impl<T> RefUnwindSafe for Pallet<T>where
T: RefUnwindSafe,
impl<T> Send for Pallet<T>where
T: Send,
impl<T> Sync for Pallet<T>where
T: Sync,
impl<T> Unpin for Pallet<T>where
T: Unpin,
impl<T> UnwindSafe for Pallet<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U, Tag> IntoTag<U, Tag> for Twhere
U: FromTag<T, Tag>,
Tag: DiscriminantTag,
impl<T, U, Tag> IntoTag<U, Tag> for Twhere
U: FromTag<T, Tag>,
Tag: DiscriminantTag,
§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T, Time> Logging<Time> for Twhere
Time: Time,
impl<T, Time> Logging<Time> for Twhere
Time: Time,
Source§const FALLBACK_TARGET: &'static str = "routine"
const FALLBACK_TARGET: &'static str = "routine"
Default logging target if none is provided.
Most routines, especially offchain workers or background tasks, use this target for simplicity.
It allows a consistent place to look for routine logs without requiring every call to specify a target.
Note: This target is only a conveninence and may be somewhat vague. To ensure errors can still be traced accurately, the logged messages should include additional metadata (e.g., module name, error index, or contextual info) so that the source of the error can be identified even if the target is generic.
Source§type Logger = DispatchError
type Logger = DispatchError
The type taken and returned for logging.
We simply return the same [DispatchError] that was logged,
so logging does not change control flow or error propagation.
DispatchError is used because in Substrate it encompasses all
runtime errors - including module errors, token errors, arithmetic
issues, and transactional boundaries - making it the universal
substrate-side error representation.
Source§type Level = LogLevel
type Level = LogLevel
The log level type.
We use the LogLevel enum to standardize severity levels
(Info, Warn, Error, Debug) across all routine logs.
Source§fn log(
level: <T as Logging<Time>>::Level,
err: &<T as Logging<Time>>::Logger,
timestamp: Time,
target: Option<&str>,
fmt: Option<fn(Time, &<T as Logging<Time>>::Level, &str, &str) -> String>,
) -> <T as Logging<Time>>::Logger
fn log( level: <T as Logging<Time>>::Level, err: &<T as Logging<Time>>::Logger, timestamp: Time, target: Option<&str>, fmt: Option<fn(Time, &<T as Logging<Time>>::Level, &str, &str) -> String>, ) -> <T as Logging<Time>>::Logger
Source§fn info(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
fn info(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
Source§fn warn(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
fn warn(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.