Expand description
Prelude to be used alongside pallet macro, for ease of use.
Re-exports§
pub use crate::dispatch::DispatchClass;
pub use crate::dispatch::DispatchResult;
pub use crate::dispatch::DispatchResultWithPostInfo;
pub use crate::dispatch::Parameter;
pub use crate::dispatch::Pays;
pub use crate::inherent::ProvideInherent;
pub use crate::storage;
pub use crate::storage::types::CountedStorageMap;
pub use crate::storage::types::CountedStorageNMap;
pub use crate::storage::types::Key as NMapKey;
pub use crate::storage::types::OptionQuery;
pub use crate::storage::types::ResultQuery;
pub use crate::storage::types::StorageDoubleMap;
pub use crate::storage::types::StorageMap;
pub use crate::storage::types::StorageNMap;
pub use crate::storage::types::StorageValue;
pub use crate::storage::types::ValueQuery;
pub use crate::storage::StorageList;
pub use crate::traits::Authorize;
pub use crate::traits::BuildGenesisConfig;
pub use crate::traits::EnsureOrigin;
pub use crate::traits::GetStorageVersion;
pub use crate::traits::Hooks;
pub use crate::traits::IsType;
pub use crate::traits::OriginTrait;
pub use crate::traits::PalletInfoAccess;
pub use crate::traits::StorageInfoTrait;
pub use crate::traits::StorageVersion;
pub use crate::traits::Task;
pub use crate::Blake2_128;
pub use crate::Blake2_128Concat;
pub use crate::Blake2_256;
pub use crate::Identity;
pub use crate::Twox128;
pub use crate::Twox256;
pub use crate::Twox64Concat;
pub use frame_support::pallet_macros::*;
Macros§
- defensive
- Generic function to mark an execution path as ONLY defensive.
- defensive_
assert - Trigger a defensive failure if a condition is not met.
- ensure
- Evaluate
$x:expr
and if not true returnErr($y:expr)
.
Structs§
- BoundedB
Tree Map - A bounded map based on a B-Tree.
- BoundedB
Tree Set - A bounded set based on a B-Tree.
- Bounded
Vec - A bounded vector.
- Const
U32 - Const getter for a basic type.
- Const
Uint - Const getter for unsigned integers.
- GetDefault
- Implement Get by returning Default for any type that implements Default.
- Inherent
Data - Inherent data to include in a block.
- Make
Fatal Error - Auxiliary to make any given error resolve to
is_fatal_error() == true
forIsFatalError
. - Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T
. - Valid
Transaction - Information concerning a valid transaction.
- Weak
Bounded Vec - A weakly bounded vector.
- Weight
Enums§
- Dispatch
Error - Reason why a dispatch call failed.
- Invalid
Transaction - An invalid transaction validity.
- Transaction
Source - The source of the transaction.
- Transaction
Validity Error - Errors that can occur while checking the validity of a transaction.
- Unknown
Transaction - An unknown transaction validity.
Constants§
- MAX_
MODULE_ ERROR_ ENCODED_ SIZE - The number of bytes of the module-specific
error
field defined inModuleError
. In FRAME, this is the maximum encoded size of a pallet error type.
Traits§
- Checked
Add - Performs addition that returns
None
instead of wrapping around on overflow. - Checked
Conversion - Convenience type to work around the highly unergonomic syntax needed
to invoke the functions of overloaded generic traits, in this case
TryFrom
andTryInto
. - Checked
Div - Performs division that returns
None
instead of panicking on division by zero and instead of wrapping around on underflow and overflow. - Checked
Mul - Performs multiplication that returns
None
instead of wrapping around on underflow or overflow. - Checked
Shl - Performs a left shift that returns
None
on shifts larger than or equal to the type width. - Checked
Shr - Performs a right shift that returns
None
on shifts larger than or equal to the type width. - Checked
Sub - Performs subtraction that returns
None
instead of wrapping around on underflow. - Decode
- Trait that allows zero-copy read of value-references from slices in LE format.
- Decode
With MemTracking - Marker trait used for identifying types that call the
Input::on_before_alloc_mem
hook while decoding. - Encode
- Trait that allows zero-copy write of value-references to slices in LE format.
- Get
- A trait for querying a single value from a type.
- MaxEncoded
Len - Items implementing
MaxEncodedLen
have a statically known maximum encoded size. - Maybe
Serialize Deserialize - A type that implements Serialize, DeserializeOwned and Debug when in std environment or serde feature is activated.
- Member
- A type that can be used in runtime structures.
- One
- Defines a multiplicative identity element for
Self
. - Type
Info - Implementors return their meta type information.
- Typed
Get - A trait for querying a single value from a type defined in the trait.
- Validate
Unsigned - Provide validation for unsigned extrinsics.
- Zero
- Defines an additive identity element for
Self
.
Type Aliases§
- Inherent
Identifier - An identifier for an inherent.
- Transaction
Longevity - Minimum number of blocks a transaction will remain valid for.
TransactionLongevity::max_value()
means “forever”. - Transaction
Priority - Priority for a transaction. Additive. Higher is better.
- Transaction
Tag - Tag for a transaction. No two transactions with the same tag should be placed on-chain.
- Transaction
Validity - Information on a transaction’s validity and, if valid, on how it relates to other transactions.
- Transaction
Validity With Refund - Information on a transaction’s validity and, if valid, on how it relates to other transactions and some refund for the operation.
- Validate
Result - Shortcut for the result value of the
validate
function.
Attribute Macros§
- inject_
runtime_ type - The optional attribute
#[inject_runtime_type]
can be attached toRuntimeCall
,RuntimeEvent
,RuntimeOrigin
orPalletInfo
in an impl statement that has#[register_default_impl]
attached to indicate that this item is generated byconstruct_runtime
. - register_
default_ impl - Attach this attribute to an impl statement that you want to use with
#[derive_impl(..)]
.
Derive Macros§
- Clone
NoBound - Derive
Clone
but do not bound any generic. - Debug
NoBound - Derive
Debug
but do not bound any generic. - Decode
- Derive
parity_scale_codec::Decode
for struct and enum. - Decode
With MemTracking - Derive
parity_scale_codec::DecodeWithMemTracking
for struct and enum. - Encode
- Derive
parity_scale_codec::Encode
andparity_scale_codec::EncodeLike
for struct and enum. - EqNo
Bound - Derive
Eq
but do not bound any generic. - MaxEncoded
Len - Derive
parity_scale_codec::MaxEncodedLen
for struct and enum. - Partial
EqNo Bound - Derive
PartialEq
but do not bound any generic. - Runtime
Debug - Runtime
Debug NoBound - Derive [
Debug
], ifstd
is enabled it usesframe_support::DebugNoBound
, ifstd
is not enabled it just returns"<wasm:stripped>"
. This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code. - Type
Info