Module frame_support::pallet_prelude
source · Expand description
Prelude to be used alongside pallet macro, for ease of use.
Re-exports
pub use crate::traits::GenesisBuild;
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::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::traits::EnsureOrigin;
pub use crate::traits::GetStorageVersion;
pub use crate::traits::Hooks;
pub use crate::traits::IsType;
pub use crate::traits::PalletInfoAccess;
pub use crate::traits::StorageInfoTrait;
pub use crate::traits::StorageVersion;
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
- Evaluate
$x:expr
and if not true returnErr($y:expr)
.
Structs
- A bounded vector.
- Const getter for a basic type.
- Implement Get by returning Default for any type that implements Default.
- Inherent data to include in a block.
- Zero-sized type used to mark things that “act like” they own a
T
. - Information concerning a valid transaction.
Enums
- Reason why a dispatch call failed.
- An invalid transaction validity.
- The source of the transaction.
- Errors that can occur while checking the validity of a transaction.
- An unknown transaction validity.
Constants
- 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
- Trait that allows zero-copy read of value-references from slices in LE format.
- Trait that allows zero-copy write of value-references to slices in LE format.
- A trait for querying a single value from a type.
- Items implementing
MaxEncodedLen
have a statically known maximum encoded size. - A type that implements Serialize, DeserializeOwned and Debug when in std environment.
- A type that can be used in runtime structures.
- Implementors return their meta type information.
- A trait for querying a single value from a type defined in the trait.
- Provide validation for unsigned extrinsics.
Type Definitions
- An identifier for an inherent.
- Minimum number of blocks a transaction will remain valid for.
TransactionLongevity::max_value()
means “forever”. - Priority for a transaction. Additive. Higher is better.
- Tag for a transaction. No two transactions with the same tag should be placed on-chain.
- Information on a transaction’s validity and, if valid, on how it relates to other transactions.
Derive Macros
- Derive
Clone
but do not bound any generic. Docs are atframe_support::CloneNoBound
. - Derive
Debug
but do not bound any generics. Docs are atframe_support::DebugNoBound
. - Derive
parity_scale_codec::Decode
and for struct and enum. - Derive
parity_scale_codec::Encode
andparity_scale_codec::EncodeLike
for struct and enum. - derive Eq but do no bound any generic. Docs are at
frame_support::EqNoBound
. - Derive
parity_scale_codec::MaxEncodedLen
for struct and enum. - Derive
PartialEq
but do not bound any generic. Docs are atframe_support::PartialEqNoBound
. - Derive [
Debug
], ifstd
is enabled it usesframe_support::DebugNoBound
, ifstd
is not enabled it just returns"<stripped>"
. This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.