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, VestingSchedule,
27	},
28	fungible, fungibles,
29	imbalance::{Imbalance, OnUnbalanced, SignedImbalance},
30	nonfungible, nonfungible_v2, nonfungibles, nonfungibles_v2, BalanceStatus,
31	ExistenceRequirement, Locker, WithdrawReasons,
32};
33
34mod members;
35#[allow(deprecated)]
36pub use members::{AllowAll, DenyAll, Filter};
37pub use members::{
38	AsContains, ChangeMembers, Contains, ContainsLengthBound, ContainsPair, Equals, Everything,
39	EverythingBut, FromContains, FromContainsPair, InitializeMembers, InsideBoth, IsInVec, Nothing,
40	RankedMembers, RankedMembersSwapHandler, SortedMembers, TheseExcept,
41};
42
43mod validation;
44pub use validation::{
45	DisabledValidators, EstimateNextNewSession, EstimateNextSessionRotation, FindAuthor,
46	KeyOwnerProofSystem, Lateness, OneSessionHandler, ValidatorRegistration, ValidatorSet,
47	ValidatorSetWithIdentification, VerifySeal,
48};
49
50mod error;
51pub use error::PalletError;
52
53mod filter;
54pub use filter::{ClearFilterGuard, FilterStack, FilterStackGuard, InstanceFilter};
55
56mod misc;
57pub use misc::{
58	defensive_prelude::{self, *},
59	AccountTouch, Backing, ConstBool, ConstI128, ConstI16, ConstI32, ConstI64, ConstI8, ConstU128,
60	ConstU16, ConstU32, ConstU64, ConstU8, DefensiveMax, DefensiveMin, DefensiveSaturating,
61	DefensiveTruncateFrom, EnsureInherentsAreFirst, EqualPrivilegeOnly, EstimateCallFee,
62	ExecuteBlock, ExtrinsicCall, Get, GetBacking, GetDefault, HandleLifetime, IsInherent,
63	IsSubType, IsType, Len, OffchainWorker, OnKilledAccount, OnNewAccount, PrivilegeCmp,
64	SameOrOther, Time, TryCollect, TryDrop, TypedGet, UnixTime, VariantCount, VariantCountOf,
65	WrapperKeepOpaque, WrapperOpaque,
66};
67#[allow(deprecated)]
68pub use misc::{PreimageProvider, PreimageRecipient};
69#[doc(hidden)]
70pub use misc::{DEFENSIVE_OP_INTERNAL_ERROR, DEFENSIVE_OP_PUBLIC_ERROR};
71
72mod stored_map;
73pub use stored_map::{StorageMapShim, StoredMap};
74mod randomness;
75pub use randomness::Randomness;
76
77mod metadata;
78pub use metadata::{
79	CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion,
80	NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess,
81	StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX,
82};
83
84mod hooks;
85#[allow(deprecated)]
86pub use hooks::GenesisBuild;
87pub use hooks::{
88	BeforeAllRuntimeMigrations, BuildGenesisConfig, Hooks, IntegrityTest, OnFinalize, OnGenesis,
89	OnIdle, OnInitialize, OnPoll, OnRuntimeUpgrade, OnTimestampSet, PostInherents,
90	PostTransactions, PreInherents, UncheckedOnRuntimeUpgrade,
91};
92
93pub mod schedule;
94mod storage;
95#[cfg(feature = "experimental")]
96pub use storage::MaybeConsideration;
97pub use storage::{
98	Consideration, Footprint, Incrementable, Instance, LinearStoragePrice, PartialStorageInfoTrait,
99	StorageInfo, StorageInfoTrait, StorageInstance, TrackedStorageKey, WhitelistedStorageKeys,
100};
101
102mod dispatch;
103#[allow(deprecated)]
104pub use dispatch::EnsureOneOf;
105pub use dispatch::{
106	AsEnsureOriginWithArg, CallerTrait, EitherOf, EitherOfDiverse, EnsureOrigin,
107	EnsureOriginEqualOrHigherPrivilege, EnsureOriginWithArg, MapSuccess, NeverEnsureOrigin,
108	OriginTrait, TryMapSuccess, TryWithMorphedArg, UnfilteredDispatchable,
109};
110
111mod voting;
112pub use voting::{ClassCountOf, PollStatus, Polling, VoteTally};
113
114mod preimages;
115pub use preimages::{Bounded, BoundedInline, FetchResult, QueryPreimage, StorePreimage};
116
117mod messages;
118pub use messages::{
119	EnqueueMessage, EnqueueWithOrigin, ExecuteOverweightError, HandleMessage, NoopServiceQueues,
120	ProcessMessage, ProcessMessageError, QueueFootprint, QueuePausedQuery, ServiceQueues,
121	TransformOrigin,
122};
123
124mod safe_mode;
125pub use safe_mode::{SafeMode, SafeModeError, SafeModeNotify};
126
127mod tx_pause;
128pub use tx_pause::{TransactionPause, TransactionPauseError};
129
130pub mod dynamic_params;
131
132pub mod tasks;
133pub use tasks::Task;
134
135mod proving;
136pub use proving::*;
137
138#[cfg(feature = "try-runtime")]
139mod try_runtime;
140#[cfg(feature = "try-runtime")]
141pub use try_runtime::{
142	Select as TryStateSelect, TryDecodeEntireStorage, TryDecodeEntireStorageError, TryState,
143	UpgradeCheckSelect,
144};