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, BalanceStatus,
32	ExistenceRequirement, Locker, WithdrawReasons,
33};
34
35mod members;
36#[allow(deprecated)]
37pub use members::{AllowAll, DenyAll, Filter};
38pub use members::{
39	AsContains, ChangeMembers, Contains, ContainsLengthBound, ContainsPair, Equals, Everything,
40	EverythingBut, FromContains, FromContainsPair, InitializeMembers, InsideBoth, IsInVec, Nothing,
41	RankedMembers, RankedMembersSwapHandler, SortedMembers, TheseExcept,
42};
43
44mod validation;
45pub use validation::{
46	DisabledValidators, EstimateNextNewSession, EstimateNextSessionRotation, FindAuthor,
47	KeyOwnerProofSystem, Lateness, OneSessionHandler, ValidatorRegistration, ValidatorSet,
48	ValidatorSetWithIdentification, VerifySeal,
49};
50
51mod error;
52pub use error::PalletError;
53
54mod filter;
55pub use filter::{ClearFilterGuard, FilterStack, FilterStackGuard, InstanceFilter};
56
57mod misc;
58pub use misc::{
59	defensive_prelude::{self, *},
60	AccountTouch, Backing, ConstBool, ConstI128, ConstI16, ConstI32, ConstI64, ConstI8, ConstInt,
61	ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, ConstUint, DefensiveMax, DefensiveMin,
62	DefensiveSaturating, DefensiveTruncateFrom, EnsureInherentsAreFirst, EqualPrivilegeOnly,
63	EstimateCallFee, ExecuteBlock, ExtrinsicCall, Get, GetBacking, GetDefault, HandleLifetime,
64	InherentBuilder, IsInherent, IsSubType, IsType, Len, OffchainWorker, OnKilledAccount,
65	OnNewAccount, PrivilegeCmp, SameOrOther, SignedTransactionBuilder, Time, TryCollect, TryDrop,
66	TypedGet, UnixTime, VariantCount, VariantCountOf, WrapperKeepOpaque, WrapperOpaque,
67};
68#[allow(deprecated)]
69pub use misc::{PreimageProvider, PreimageRecipient};
70#[doc(hidden)]
71pub use misc::{DEFENSIVE_OP_INTERNAL_ERROR, DEFENSIVE_OP_PUBLIC_ERROR};
72
73mod stored_map;
74pub use stored_map::{StorageMapShim, StoredMap};
75mod randomness;
76pub use randomness::Randomness;
77
78mod metadata;
79pub use metadata::{
80	CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion,
81	NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess,
82	StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX,
83};
84
85mod hooks;
86#[allow(deprecated)]
87pub use hooks::GenesisBuild;
88pub use hooks::{
89	BeforeAllRuntimeMigrations, BuildGenesisConfig, Hooks, IntegrityTest, OnFinalize, OnGenesis,
90	OnIdle, OnInitialize, OnPoll, OnRuntimeUpgrade, OnTimestampSet, PostInherents,
91	PostTransactions, PreInherents, UncheckedOnRuntimeUpgrade,
92};
93
94pub mod schedule;
95mod storage;
96#[cfg(feature = "experimental")]
97pub use storage::MaybeConsideration;
98pub use storage::{
99	Consideration, ConstantStoragePrice, Disabled, Footprint, Incrementable, Instance,
100	LinearStoragePrice, PartialStorageInfoTrait, StorageInfo, StorageInfoTrait, StorageInstance,
101	TrackedStorageKey, WhitelistedStorageKeys,
102};
103
104mod dispatch;
105#[allow(deprecated)]
106pub use dispatch::EnsureOneOf;
107pub use dispatch::{
108	AsEnsureOriginWithArg, 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	EnqueueMessage, EnqueueWithOrigin, ExecuteOverweightError, HandleMessage, NoopServiceQueues,
122	ProcessMessage, ProcessMessageError, QueueFootprint, QueuePausedQuery, ServiceQueues,
123	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
140#[cfg(feature = "try-runtime")]
141mod try_runtime;
142#[cfg(feature = "try-runtime")]
143pub use try_runtime::{
144	Select as TryStateSelect, TryDecodeEntireStorage, TryDecodeEntireStorageError, TryState,
145	UpgradeCheckSelect,
146};