pub enum Error<T, I = ()> {
Show 69 variants
DigestNotFoundToDetermine,
InsufficientFunds,
CommitAlreadyExists,
CannotGenerateDigest,
MarkerCommitNotAllowed,
CommitNotFound,
DigestNotFound,
IndexNotFound,
EntryOfIndexNotFound,
IndexDigestTaken,
DigestHasFunds,
IndexHasFunds,
PoolNotFound,
SlotOfPoolNotFound,
PoolManagerNotFound,
PoolDigestTaken,
PoolHasFunds,
DigestVariantBalanceNotFound,
MaxAssetIssued,
MaxAssetReaped,
ShareCannotBeZero,
CapitalCannotBeZero,
ShareGreaterThanCapital,
MintingMoreThanIssued,
BurningMoreThanReapable,
ExpectsHoldWithdrawal,
ReserveLiquidOverflow,
ExpectsFreezeAndHoldWithdrawal,
InvalidDigestModel,
VariantsExhausted,
TooSmallShareValue,
DepositDeriveOverflowed,
FactorGreaterThanOne,
MaxIndexCapacityReached,
CommitNotFoundForEntry,
CommitNotFoundForSlot,
CommitNotFoundForPool,
DepositAccumulationExhausted,
EntryDigestNotFound,
WithdrawAccumulationExhausted,
CommitsAccumulationExhausted,
ReleasePoolToRecover,
EmptySlotsNotAllowed,
CapitalUnderflowed,
CapitalOverflowed,
MaxSlotsReached,
SlotDigestNotFound,
MaxCommitsReached,
MaxEntriesReached,
CommitsNotFoundForReason,
IndexBalanceUnderflow,
InvalidCommitVariantIndex,
ZeroMaxCommits,
TriedCreatingHaltedIndexes,
EmptyEntriesNotAllowed,
EmptyCommitsNotAllowed,
DuplicateEntry,
DuplicateSlot,
CommitConstructionFailed,
EntryCommitNotFound,
CorruptedPlugin,
DerivedLessThanZeroValue,
WithdrawalOverflow,
CommissionOverflow,
PoolUnsupported,
MintingOffLimits,
ReapingOffLimits,
PlacingOffLimits,
RaisingOffLimits,
// some variants omitted
}Expand description
Commitment Pallet Errors
Variants§
DigestNotFoundToDetermine
Digest not found in the system. Cannot determine whether it is a direct digest, index, or pool.
InsufficientFunds
Insufficient funds for the requested operation.
Consider forcing the operation or reducing the given asset value.
CommitAlreadyExists
The proprietor already holds a commitment for the reason.
Only a single commit should exist for a reason. Utilize indexes and pools in case of distributing multiple commitments.
CannotGenerateDigest
Failed to generate a digest for a given source or index/pool structure.
MarkerCommitNotAllowed
A commitment with zero value is invalid.
Commitments are economic in nature and must not be used as zero-value markers.
CommitNotFound
The proprietor’s commit was not found in the system.
DigestNotFound
The specified direct-digest was not found in the system.
IndexNotFound
The specified index digest was not found in the system.
EntryOfIndexNotFound
The specified entry digest is not found in the index.
IndexDigestTaken
The specified index digest already exists for the given reason.
DigestHasFunds
Attempted to remove/reap a direct-digest that still holds funds.
IndexHasFunds
Attempted to remove/reap an index that still holds funds.
PoolNotFound
The specified pool digest was not found in the system.
SlotOfPoolNotFound
The specified slot digest is not found in the pool.
PoolManagerNotFound
The Manager for the specified Pool is not found. A Pool is expected to have a manager at all times.
PoolDigestTaken
The specified pool digest already exists for the given reason.
PoolHasFunds
Attempted to remove/reap a pool that still holds funds.
DigestVariantBalanceNotFound
The direct-digest balance specialized for the given commit-variant (position) is not initialized or found to be.
It can only be initialized during deposit operations. Not while being queried.
MaxAssetIssued
Cannot include more asset value for issuing as the total issue balance exhausted.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
MaxAssetReaped
Cannot include more asset value for reaping as the total reapable balance exhausted.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
Shares given for an index’s entry or a pool’s slot cannot be zero. Marker entries or slots are invalid in the system.
CapitalCannotBeZero
Capital cannot be zero when creating an index or pool.
Correct behavior:
- Index/Pool must have
sum(shares) == capital. - Entries/Slots must not have empty shares.
Share value exceeded capital when creating an index or pool.
Correct behavior: every entry/slot must satisfy share <= capital.
MintingMoreThanIssued
Asset Issued and Minting to the underlying fungible system detected inconsistency.
BurningMoreThanReapable
Asset To Reap and Burning to the underlying fungible system detected inconsistency.
ExpectsHoldWithdrawal
Indicates that the operation expects the proprietor’s existing reserves
(held funds) to be released in order to proceed, typically to be
re-deposited under the commitment hold reason (PrepareForCommit).
If this is not possible, the operation may attempt to proceed by forcing withdrawal from liquid funds, potentially risking account closure if enforced by the asset provider or best-effort methods.
ReserveLiquidOverflow
Asset units overflown when commit-reserve balance is added with liquidly held funds.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
ExpectsFreezeAndHoldWithdrawal
Indicates that the operation expects the proprietor’s existing reserves
(held funds) and freezes (locked funds) to be released in order to proceed,
typically to be re-deposited under the commitment hold reason (PrepareForCommit).
Since, the operation cannot attempt to proceed by forcing withdrawal from just liquid funds, as its insufficient.
Try to reduce provided asset amount or do operation based on best-effort possible only.
InvalidDigestModel
The Model of Digest constructed is invalid, since its possibly a compile time marker.
VariantsExhausted
Digest commit-variant (positional) balances are exhausted or at maximum capacity.
This reveals that the Config::Position’s trait PositionIndex
is implemented not as-per its defined invariants.
Share value is too small (underflow) to produce a valid
factor when calculating share/capital.
Possible resolutions:
- Increase the fixed-point precision of
Biasin future upgrades. - Increase the index entry or pool slot’s share value and retry.
DepositDeriveOverflowed
Deposit derivation overflowed during index or pool deposit operation.
Occurs when an excessively high share/capital ratio, multiplied by
a balance value, overflows the scalar.
FactorGreaterThanOne
share/capital ratio produced a factor greater than 1.
This results in errors which may indicate invariants are broken.
sum(shares) <= capitalor,current_share > capital
MaxIndexCapacityReached
Index total balance (deposits-only) has reached its maximum top-level capacity.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
CommitNotFoundForEntry
Proprietor doesn’t hold commits for the specified entry of an index.
Indicates that the prorprietor haven’t committed to the index at all.
CommitNotFoundForSlot
Proprietor doesn’t hold commits for the specified slot of a pool.
Indicates that the prorprietor haven’t committed to the pool at all.
CommitNotFoundForPool
Proprietor doesn’t hold commits for the specified pool.
DepositAccumulationExhausted
Accumulating total deposit for direct and indirect digests (index/pools) has overflowed the provided asset type.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
EntryDigestNotFound
The digest for the specified entry of index was not found in the list of digests.
The digest list represents the underlying direct digests for which commitments have been made.
WithdrawAccumulationExhausted
Accumulating total withdrawal for direct or indirect digests (pool/index) has overflowed the provided asset type.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
CommitsAccumulationExhausted
Accumulating total real-time values of all commit instances has overflowed the provided asset type.
- For non-issuance assets: migrate to a larger scalar type immediately.
- For issuance assets: conduct an internal audit on the asset (unexpected behavior).
ReleasePoolToRecover
Indicates that a pool was recovered without being released i.e., empty.
EmptySlotsNotAllowed
The specified pool requires atleast a single slot, with valid shares to carry the operation.
CapitalUnderflowed
Capital shares underflowed during index or pool creation/modification.
CapitalOverflowed
Capital shares overflowed during index or pool creation/modification.
MaxSlotsReached
Maximum number of slots in a pool is reached.
SlotDigestNotFound
The digest for the specified slot of pool was not found in the list of digests.
The digest list represents the underlying direct digests for which commitments have been made.
MaxCommitsReached
Max Commits per reason (as per commitment invariant for a single digest model) is exhausted.
Try resolving and committing a new value instead to the same digest model.
MaxEntriesReached
Maximum number of entries in an index is reached.
CommitsNotFoundForReason
Reason exists (as its compile-time proved) but contains no commitments.
IndexBalanceUnderflow
Index logic is broken, since withdrawing index balance is only for higher level queries and deposits (principal) is only withdrawn.
InvalidCommitVariantIndex
There exists an invalid commit-variant Config::Position via invalid
trait implementation of PositionIndex.
Indicates the position cannot be derived from the positional index or that the index doesn’t pertain to the actual position.
ZeroMaxCommits
This pallet instance’s maximum commitment per proprietor configuration is set at zero, effectively restricts the commitment-pallet’s operations.
Require Config::MaxCommits to be set to more than zero to operate.
TriedCreatingHaltedIndexes
This pallet instance’s index and pool support is halted via setting
Config::MaxIndexEntries to zero and tried attempting to create an
index (and in future pools via indexes).
If indexes and pools are required Config::MaxIndexEntries should be set
to more than zero.
EmptyEntriesNotAllowed
Attempted to create index via empty entries. Indexes require valid entries, with non-zero share values.
It is to note that pools are created via existing indexes and pool slots are mutated via valid individual entries.
EmptyCommitsNotAllowed
A proprietor’s commit is found to be empty without any commit-instance which is an invalid state.
DuplicateEntry
Attempted to insert a duplicate entry into an index.
DuplicateSlot
Attempted to insert a duplicate slot into a pool.
CommitConstructionFailed
For reasons unknown, the commit-instance construction has failed.
EntryCommitNotFound
The required entry’s commit for proprietor is not found while raising commit.
CorruptedPlugin
The balance plugin was corrupted
DerivedLessThanZeroValue
During Division Scaling the value underflowed, which is fallible only if the accuracy (denominator) is invalid.
WithdrawalOverflow
Withdraw derivation overflowed during index or pool deposit operation.
Occurs when an excessively high share/capital ratio, multiplied by
a balance value, overflows the scalar.
CommissionOverflow
Derived Commission Amount Overflowed the Scalar Asset Type.
PoolUnsupported
Pools are unsupported when the underlying balance plugin cannot guarantee precision-exact and forceful (unbounded) operations.
Pools maintain their own top-level balance and rely on exact value propagation and forced execution to remain consistent. If the plugin enforces limits even under forced execution, these requirements cannot be satisfied, making pool semantics invalid.
MintingOffLimits
Direct Digest Minting exceeded allowed limits by the underlying Lazy Balance Plugin Family for the current operation.
ReapingOffLimits
Direct Digest Reaping (Burning) exceeded allowed limits by the underlying Lazy Balance Plugin Family for the current operation.
PlacingOffLimits
Placing a new commitment has exceeded allowed deposit limits by the underlying Lazy Balance Plugin Family for the current operation.
RaisingOffLimits
Increasing (raising) an existing commitment has exceeded allowed raising (deposit) limits by the underlying Lazy Balance Plugin Family for the current operation.
Trait Implementations§
Source§impl<T, I> Decode for Error<T, I>
impl<T, I> Decode for Error<T, I>
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, I> Encode for Error<T, I>
impl<T, I> Encode for Error<T, I>
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, I> PalletError for Error<T, I>
impl<T, I> PalletError for Error<T, I>
Source§const MAX_ENCODED_SIZE: usize = 1usize
const MAX_ENCODED_SIZE: usize = 1usize
Source§impl<T, I> TypeInfo for Error<T, I>where
PhantomData<(T, I)>: TypeInfo + 'static,
T: 'static,
I: 'static,
impl<T, I> TypeInfo for Error<T, I>where
PhantomData<(T, I)>: TypeInfo + 'static,
T: 'static,
I: 'static,
impl<T, I> DecodeWithMemTracking for Error<T, I>
impl<T, I> EncodeLike for Error<T, I>
Auto Trait Implementations§
impl<T, I> Freeze for Error<T, I>
impl<T, I> RefUnwindSafe for Error<T, I>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<T, I> Send for Error<T, I>
impl<T, I> Sync for Error<T, I>
impl<T, I> Unpin for Error<T, I>
impl<T, I> UnwindSafe for Error<T, I>where
T: UnwindSafe,
I: 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.