pub enum Error<T> {
Show 40 variants
AuthorNotFound,
InadequateCollateral,
InadequateFunds,
AlreadyEnrolled,
AuthorIsActive,
AuthorInProbation,
AuthorResigned,
AuthorHasPenalties,
AuthorActivated,
CannotGenerateCommitDigest,
AuthorHasRewards,
FundDoesNotExist,
AuthorDigestNotFound,
FundedToAnotherDigest,
AuthorNotInIndex,
AuthorNotInPool,
BelowMinimumFund,
AboveMaximumExposure,
CannotFundOnCollateral,
RewardNotFound,
PenaltyNotFound,
AuthorTotalHoldExhausted,
ContainsNoRewards,
ContainsNoPenalties,
FinalizedObligations,
AuthorNeedsMoreCollateral,
ZeroPenaltyFound,
AuthorIsUnsafe,
RedundantResignation,
InadequateCandidatesToElect,
NoElectsFound,
AuthorNotElected,
MinElectedNotReached,
RiskWithinThreshold,
AuthorMismatch,
InvalidPoolManager,
MinCollateralZero,
MinGreaterThanMax,
NonZeroConfigRequired,
FundingOffLimits,
// some variants omitted
}Expand description
The Error enum of this pallet.
Variants§
AuthorNotFound
The specified author is not found in the system.
InadequateCollateral
Lesser than minimum collateral provided for author role enrollment.
InadequateFunds
Lesser than minimum requirement funds provided for enroll/funding operation.
AlreadyEnrolled
Redundant enrollment for an already existing author.
AuthorIsActive
Author is actively participating in their assigned/enrolled duties.
Either internally or externally by other pallets.
AuthorInProbation
The specified author is undergoing probation period.
AuthorResigned
Author has resigned and must undergo a new enrollment to rejoin.
AuthorHasPenalties
Author has pending penalties that must finalize before the operation can proceed.
AuthorActivated
Once an author is active after probation, cannot undergo probation again.
CannotGenerateCommitDigest
Digest cannot be generated for author for external funding (commitment).
AuthorHasRewards
Author has pending rewards that must finalize before the operation can proceed.
FundDoesNotExist
The requested external backing/fund does not exist.
AuthorDigestNotFound
The author’s funding digest/hash is not found in the system.
FundedToAnotherDigest
The backer funded another author’s digest, not the specified author.
May correspond to an index or pool digest.
AuthorNotInIndex
Author’s funding digest is not available in the index entries.
AuthorNotInPool
Author’s funding digest is not available in the pool’s slots.
BelowMinimumFund
Minimum fund not attained, either locally (author-defined) or globally.
AboveMaximumExposure
Funds exceed maximum exposable amount, either locally (author-defined) or globally.
CannotFundOnCollateral
Author is attempting to fund on top of collateral, which is not allowed.
RewardNotFound
The requested reward for author is not found in pending rewards.
PenaltyNotFound
The requested penalty for author is not found in pending penalties.
AuthorTotalHoldExhausted
The total hold of an author, including all funds and collateral, overflowed.
If the commitment asset is non-issuance based, update the scalar type to maximum precision. If issuance-based, an internal audit into the asset is expected.
ContainsNoRewards
The requested timestamp doesn’t contain any pending rewards.
ContainsNoPenalties
The requested timestamp doesn’t contain any pending penalties.
FinalizedObligations
The requested timestamp has finalized all obligations, such as pending rewards or penalties.
AuthorNeedsMoreCollateral
Author is under-collateralized due to increased system requirements to continue operations.
ZeroPenaltyFound
The given penalty factor is zero and cannot be applied for penalization of authors.
AuthorIsUnsafe
The author is deemed risky (unsafe); operation cannot proceed.
Not a permanent condition: can be resolved with positive activities.
RedundantResignation
Already resigned author attempting resignation again.
InadequateCandidatesToElect
The provided candidate set was too small to begin an election.
This occurs when the number of candidates passed to the election process is less than the configured minimum.
NoElectsFound
No elected authors were found in storage or the election produced zero winners.
This may occur in two cases:
- When attempting to reveal or access election results but no election data has been recorded for the current or recent round.
- When an election process completed but resulted in zero elected candidates, indicating either a lack of eligible participants or a model configuration issue.
AuthorNotElected
The given author is not elected in the recent election.
MinElectedNotReached
The number of elected authors did not reach the configured minimum.
Triggered during the election storage phase when the computed results contain fewer authors than required.
RiskWithinThreshold
The author’s accumulated risk has not crossed the revocation limit.
This error is returned when an operation requires the author to have
exceeded the allowed risk window, but the author’s risk_until
is still less than or equal to:
current_block + ProbationPeriod.
In this state, the author remains valid and cannot yet be revoked.
AuthorMismatch
The provided author does not match the expected author for the operation.
This error is returned when an operation references an author that is inconsistent with the stored author context or resolved digest.
InvalidPoolManager
The caller is not the current manager of the specified funding pool.
MinCollateralZero
The minimum collateral value cannot be zero.
This error is returned when attempting to set the minimum required
collateral to 0. The minimum collateral must be greater than zero.
MinGreaterThanMax
A minimum configuration value exceeds its corresponding maximum value.
This error is returned when a parameter that represents a lower bound
(e.g., MinElected, MinFund) is set greater than its associated
upper bound (e.g., MaxElected, MaxExposure).
Ensures logical consistency between related configuration limits.
NonZeroConfigRequired
A configuration parameter that must be strictly greater than zero was provided as zero.
This error is returned when attempting to set a non-zero-required
global parameter (such as MinCollateral, MinFund,
MinElected, or MaxElected) to 0.
Prevents invalid economic or election configuration.
FundingOffLimits
Initiating a fund (backing) has exceeded allowed funding limits either globally or locally by the receiving model (author/index/pool) or low-level balances.
Trait Implementations§
Source§impl<T> Decode for Error<T>
impl<T> Decode for Error<T>
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Source§impl<T> Encode for Error<T>
impl<T> Encode for Error<T>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T> PalletError for Error<T>
impl<T> PalletError for Error<T>
Source§const MAX_ENCODED_SIZE: usize = 1usize
const MAX_ENCODED_SIZE: usize = 1usize
Source§impl<T> TypeInfo for Error<T>where
PhantomData<T>: TypeInfo + 'static,
T: 'static,
impl<T> TypeInfo for Error<T>where
PhantomData<T>: TypeInfo + 'static,
T: 'static,
impl<T> DecodeWithMemTracking for Error<T>
impl<T> EncodeLike for Error<T>
Auto Trait Implementations§
impl<T> Freeze for Error<T>
impl<T> RefUnwindSafe for Error<T>where
T: RefUnwindSafe,
impl<T> Send for Error<T>where
T: Send,
impl<T> Sync for Error<T>where
T: Sync,
impl<T> Unpin for Error<T>where
T: Unpin,
impl<T> UnwindSafe for Error<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>,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
§impl<T> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere
T: Codec,
§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
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
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.