frame_support/
traits.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! Traits and associated utilities for use in the FRAME environment.
19//!
20//! NOTE: If you're looking for `parameter_types`, it has moved in to the top-level module.
21
22pub mod tokens;
23pub use tokens::{
24	currency::{
25		ActiveIssuanceOf, Currency, InspectLockableCurrency, LockIdentifier, LockableCurrency,
26		NamedReservableCurrency, ReservableCurrency, TotalIssuanceOf, VestedTransfer,
27		VestingSchedule,
28	},
29	fungible, fungibles,
30	imbalance::{Imbalance, OnUnbalanced, SignedImbalance},
31	nonfungible, nonfungible_v2, nonfungibles, nonfungibles_v2,
32	stable::PsmInterface,
33	BalanceStatus, ExistenceRequirement, Locker, WithdrawReasons,
34};
35
36mod members;
37#[allow(deprecated)]
38pub use members::{AllowAll, DenyAll, Filter};
39pub use members::{
40	AsContains, ChangeMembers, Contains, ContainsLengthBound, ContainsPair, Equals, Everything,
41	EverythingBut, FromContains, FromContainsPair, InitializeMembers, InsideBoth, IsInVec, Nothing,
42	RankedMembers, RankedMembersSwapHandler, SortedMembers, TheseExcept,
43};
44
45mod validation;
46pub use validation::{
47	DisabledValidators, EstimateNextNewSession, EstimateNextSessionRotation, FindAuthor,
48	KeyOwnerProofSystem, Lateness, OneSessionHandler, ValidatorRegistration, ValidatorSet,
49	ValidatorSetWithIdentification, VerifySeal,
50};
51
52mod error;
53pub use error::PalletError;
54
55mod filter;
56pub use filter::{ClearFilterGuard, FilterStack, FilterStackGuard, InstanceFilter};
57
58mod misc;
59pub use misc::{
60	defensive_prelude::{self, *},
61	AccountTouch, Backing, ConstBool, ConstI128, ConstI16, ConstI32, ConstI64, ConstI8, ConstInt,
62	ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, ConstUint, DefensiveMax, DefensiveMin,
63	DefensiveSaturating, DefensiveTruncateFrom, DefensiveTruncateInto, EqualPrivilegeOnly,
64	EstimateCallFee, ExecuteBlock, Get, GetBacking, GetDefault, HandleLifetime, InherentBuilder,
65	IsInherent, IsSubType, IsType, Len, OffchainWorker, OnKilledAccount, OnNewAccount,
66	PrivilegeCmp, RewardsReporter, SameOrOther, SignedTransactionBuilder, Time, TryCollect,
67	TryDrop, TypedGet, UnixTime, VariantCount, VariantCountOf, WrapperKeepOpaque, WrapperOpaque,
68};
69#[allow(deprecated)]
70pub use misc::{PreimageProvider, PreimageRecipient};
71#[doc(hidden)]
72pub use misc::{DEFENSIVE_OP_INTERNAL_ERROR, DEFENSIVE_OP_PUBLIC_ERROR};
73
74mod stored_map;
75pub use stored_map::{StorageMapShim, StoredMap};
76mod randomness;
77pub use randomness::Randomness;
78pub mod reality;
79
80mod metadata;
81pub use metadata::{
82	CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion,
83	NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess,
84	StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX,
85};
86
87mod hooks;
88#[allow(deprecated)]
89pub use hooks::GenesisBuild;
90pub use hooks::{
91	BeforeAllRuntimeMigrations, BuildGenesisConfig, Hooks, IntegrityTest, OnFinalize, OnGenesis,
92	OnIdle, OnInitialize, OnPoll, OnRuntimeUpgrade, OnTimestampSet, PostInherents,
93	PostTransactions, PreInherents, UncheckedOnRuntimeUpgrade,
94};
95
96pub mod schedule;
97mod storage;
98#[cfg(feature = "experimental")]
99pub use storage::MaybeConsideration;
100pub use storage::{
101	Consideration, ConstantStoragePrice, Disabled, Footprint, Incrementable, Instance,
102	LinearStoragePrice, NoDrop, PartialStorageInfoTrait, StorageInfo, StorageInfoTrait,
103	StorageInstance, SuppressedDrop, TrackedStorageKey, WhitelistedStorageKeys,
104};
105
106mod dispatch;
107pub use dispatch::{
108	AsEnsureOriginWithArg, Authorize, CallerTrait, EitherOf, EitherOfDiverse, EnsureOrigin,
109	EnsureOriginEqualOrHigherPrivilege, EnsureOriginWithArg, MapSuccess, NeverEnsureOrigin,
110	OriginTrait, TryMapSuccess, TryWithMorphedArg, UnfilteredDispatchable,
111};
112
113mod voting;
114pub use voting::{ClassCountOf, NoOpPoll, PollStatus, Polling, VoteTally};
115
116mod preimages;
117pub use preimages::{Bounded, BoundedInline, FetchResult, QueryPreimage, StorePreimage};
118
119mod messages;
120pub use messages::{
121	BatchFootprint, BatchesFootprints, EnqueueMessage, EnqueueWithOrigin, ExecuteOverweightError,
122	HandleMessage, NoopServiceQueues, ProcessMessage, ProcessMessageError, QueueFootprint,
123	QueueFootprintQuery, QueuePausedQuery, ServiceQueues, TransformOrigin,
124};
125
126mod safe_mode;
127pub use safe_mode::{SafeMode, SafeModeError, SafeModeNotify};
128
129mod tx_pause;
130pub use tx_pause::{TransactionPause, TransactionPauseError};
131
132pub mod dynamic_params;
133
134pub mod tasks;
135pub use tasks::Task;
136
137mod proving;
138pub use proving::*;
139
140mod rewards;
141pub use rewards::RewardsPool;
142
143#[cfg(feature = "try-runtime")]
144mod try_runtime;
145#[cfg(feature = "try-runtime")]
146pub use try_runtime::{
147	Select as TryStateSelect, TryDecodeEntireStorage, TryDecodeEntireStorageError, TryState,
148	UpgradeCheckSelect,
149};