Module frame_support::traits
source · Expand description
Traits and associated utilities for use in the FRAME environment.
NOTE: If you’re looking for parameter_types
, it has moved in to the top-level module.
Re-exports
pub use tokens::currency::Currency;
pub use tokens::currency::TotalIssuanceOf;
pub use tokens::fungible;
pub use tokens::fungibles;
pub use tokens::imbalance::Imbalance;
Modules
Prelude module for all defensive traits to be imported at once.
Traits and associated utilities for scheduling dispatchables in FRAME.
Traits for working with tokens and their associated datastructures.
Structs
Adapter struct for turning an
OrderedMembership
impl into a Contains
impl.Some amount of backing from a group. The precise definition of what it means to “back” something
is left flexible.
The function and pallet name of the Call.
Guard type for clearing all pushed constraints from a
FilterStack
and reinstating them when
dropped.Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
Const getter for a basic type.
The version of a crate.
“OR gate” implementation of
EnsureOrigin
, Success
type for both L
and R
must
be equal.“OR gate” implementation of
EnsureOrigin
allowing for different Success
types for L
and R
, with them combined using an Either
type.Implementation of
PrivilegeCmp
that only checks for equal origins.A
Contains
implementation that contains everything except the values in Exclude
.Guard type for pushing a constraint to a
FilterStack
and popping when dropped.Converter
struct
to use a ContainsPair
implementation for a Contains
bound.Implement Get by returning Default for any type that implements Default.
Trivial utility for implementing
Contains
/OrderedMembership
with a Vec
.A derivative
EnsureOrigin
implementation. It mutates the Success
result of an Original
implementation with a given Mutator
.EnsureOrigin
implementation that always fails.Information regarding an instance of a pallet.
A naive implementation of
CurrencyConvert
that simply saturates all conversions.Metadata about storage from the runtime.
A shim for placing around a storage item in order to use it as a
StoredValue
. Ideally this
wouldn’t be needed as StorageValue
s should blanket implement StoredValue
s, however this
would break the ability to have custom impls of StoredValue
. The other workaround is to
implement it directly in the macro.The storage version of a pallet.
A derivative
EnsureOrigin
implementation. It mutates the Success
result of an Original
implementation with a given Mutator
, allowing the possibility of an error to be returned
from the mutator.An implementation of
CurrencyToVote
tailored for chain’s that have a balance type of u128.Reasons for moving funds out of an account.
A wrapper for any type
T
which implement encode/decode in a way compatible with Vec<u8>
.A wrapper for any type
T
which implement encode/decode in a way compatible with Vec<u8>
.Enums
Status of funds.
A
Contains
implementation that contains every value.Simple boolean for whether an account needs to be kept in existence.
Return type used when we need to return one of two items, each of the opposite direction or
sign, with one (
Same
) being of the same type as the self
or primary argument of the function
that returned it.Either a positive or a negative imbalance.
Constants
The storage key postfix that is used to store the
StorageVersion
per pallet.Traits
Trait for type that can handle incremental changes to a set of account IDs.
A trait for querying whether a type can be said to “contain” a value.
A trait for querying bound for the length of an implementation of
Contains
A trait for querying whether a type can be said to “contain” a pair-value.
A trait similar to
Convert
to convert values from B
an abstract balance type
into u64 and back from u128. (This conversion is used in election and other places where complex
calculation over balance type is needed)A trait to handle errors and options when you are really sure that a condition must hold, but
not brave enough to
expect
on it, or a default fallback value makes more sense.Subset of methods similar to
Defensive
that can only work for a Option
.Subset of methods similar to
Defensive
that can only work for a Result
.A variant of
Defensive
with the same rationale, for the arithmetic operations where in
case an infallible operation fails, it saturates.Trait used to check whether a given validator is currently disabled and should not be
participating in consensus (e.g. because they equivocated).
A trait to ensure the inherent are before non-inherent in a block.
Some sort of check on the origin is performed by this object.
Some sort of check on the origin is performed by this object.
Something that can estimate the fee of a (frame-based) call.
Something that can estimate at which block scheduling of the next session will happen (i.e when
we will try to fetch new validators).
Something that can estimate at which block the next session rotation will happen (i.e. a new
session starts).
Something that can execute a given block.
An extrinsic on which we can get access to call.
FilterDeprecated
Trait to add a constraint onto the filter.
A trait for finding the author of a block header based on the
PreRuntime
digests contained
within it.A trait to define the build function of a genesis config, T and I are placeholder for pallet
trait and pallet instance.
A trait for querying a single value from a type.
Retrieve the backing from an object’s ref.
Gets the metadata for the Call - function name and pallet name.
Gets the function name of the Call.
Provides information about the storage version of a pallet.
A simple, generic one-parameter event notifier/handler.
The pallet hooks trait. Implementing this lets you express some logic to execute.
Trait for type that can handle the initialization of account IDs at genesis.
An instance of a pallet in the storage.
Simple trait for providing a filter over a reference to some type, given an instance of itself.
Type that provide some integrity tests.
Something that can be checked to be a of sub type
T
.Trait to be used when types are exactly same.
Something which can compute and check proofs of
a historical key owner and return full identification data of that
key owner.
Trait to be used by block producing consensus engine modules to determine
how late the current block is (e.g. in a slot-based proposal mechanism how
many slots were skipped since the previous block).
Anything that can have a
::len()
method.A currency whose accounts can have liquidity restrictions.
Trait to handle asset locking mechanism to ensure interactions with the asset can be implemented
downstream to extend logic of Uniques current functionality.
Off-chain computation trait.
The block finalization trait.
A trait that will be called at genesis.
The block’s on idle trait.
The block initialization trait.
The account with the given id was reaped.
Handler for when a new account has been created.
The runtime upgrade trait.
Some helper functions for
OnRuntimeUpgrade
during try-runtime
testing.A trait which is called when the timestamp is set in the runtime.
Handler for when some currency “account” decreased in balance for
some reason.
A session handler for specific key type.
Methods available on
frame_system::Config::Origin
.Trait indicating that the implementing type is going to be included as a field in a variant of
the
#[pallet::error]
enum type.Provides information about the pallet itself and its setup in the runtime.
Provides information about the pallet itself and its setup in the runtime.
Provide information about a bunch of pallets.
Similar to
StorageInfoTrait
, a trait to give partial information about storage.A interface for looking up preimages from their hash on chain.
A interface for managing preimages to hashes on chain.
Something that can compare privileges of two origins.
A trait that is able to provide randomness.
A currency where funds can be reserved from the user.
A trait for a set which can enumerate its members in order.
A trait to give information about storage.
An instance of a storage in a pallet.
An abstraction of a value stored within storage, but possibly as part of a larger composite
item.
Try and collect into a collection
C
.A type for which some values make sense to be able to drop without further consideration.
Execute some checks to ensure the internal state of a pallet is consistent.
A trait for querying a single value from a type defined in the trait.
Type that can be dispatched with an origin but without checking the origin filter.
Trait to deal with unix time.
Implementors of this trait provide information about whether or not some validator has
been registered with them. The Session module is an
implementor.
A trait for online node inspection in a session.
ValidatorSet
combined with an identification.A trait for verifying the seal of a header and returning the author.
A vesting schedule over a currency. This allows a particular currency to have vesting limits
applied to it.
Type Definitions
AllowAllDeprecated
DenyAllDeprecated
EnsureOneOfDeprecated
“OR gate” implementation of
EnsureOrigin
allowing for different Success
types for L
and R
, with them combined using an Either
type.An identifier for a lock. Used for disambiguating different locks so that
they can be individually replaced or removed.