Skip to content

Commit

Permalink
Bounded types to main prelude, common types to umbrella
Browse files Browse the repository at this point in the history
  • Loading branch information
runcomet committed Jan 30, 2025
1 parent 5d5400a commit 85afcc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions substrate/frame/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ extern crate alloc;

use alloc::vec::Vec;
use codec::{Decode, Encode, MaxEncodedLen};
use frame::{
runtime::prelude::*,
traits::{DisabledValidators, FindAuthor, IsMember, OnTimestampSet, OneSessionHandler},
};
use frame::prelude::*;
use log;

#[cfg(feature = "try-runtime")]
Expand Down
20 changes: 10 additions & 10 deletions substrate/frame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ pub mod prelude {
pub use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
pub use frame_support::traits::{
Contains, EitherOf, EstimateNextSessionRotation, Everything, IsSubType, MapSuccess,
NoOpPoll, OnRuntimeUpgrade, OneSessionHandler, RankedMembers, RankedMembersSwapHandler,
VariantCount, VariantCountOf,
NoOpPoll, OnRuntimeUpgrade, OnTimestampSet, OneSessionHandler, RankedMembers,
RankedMembersSwapHandler, VariantCount, VariantCountOf,
};

/// Pallet prelude of `frame-system`.
Expand All @@ -223,6 +223,9 @@ pub mod prelude {
/// All hashing related things
pub use super::cryptography::*;

/// Bounded storage related types.
pub use sp_runtime::{BoundedSlice, BoundedVec};

/// Consensus types needed in runtime construction.
pub use super::consensus::*;

Expand All @@ -235,13 +238,10 @@ pub mod prelude {
/// Runtime traits
#[doc(no_inline)]
pub use sp_runtime::traits::{
BlockNumberProvider, Bounded, Convert, DispatchInfoOf, Dispatchable, ReduceBy,
BlockNumberProvider, Bounded, Convert, DispatchInfoOf, Dispatchable, IsMember, ReduceBy,
ReplaceWithDefault, SaturatedConversion, Saturating, StaticLookup, TrailingZeroInput,
};

/// Bounded storage related types.
pub use sp_runtime::{BoundedSlice, BoundedVec};

/// Other error/result types for runtime
#[doc(no_inline)]
pub use sp_runtime::{
Expand Down Expand Up @@ -366,9 +366,6 @@ pub mod runtime {
/// Consider using the new version of this [`frame_construct_runtime`].
pub use frame_support::construct_runtime;

/// Related to runtime construction.
pub use frame_support::{BoundedSlice, BoundedVec};

/// Macro to amalgamate the runtime into `struct Runtime`.
///
/// This is the newer version of [`construct_runtime`].
Expand Down Expand Up @@ -547,6 +544,8 @@ pub mod arithmetic {
}

/// Consensus types
///
/// This is already part of the ['prelude`].
pub mod consensus {
pub use sp_consensus_aura::{
ed25519::AuthorityId, AuthorityIndex, ConsensusLog, Slot, AURA_ENGINE_ID,
Expand Down Expand Up @@ -583,7 +582,8 @@ pub mod cryptography {
/// This is already part of the [`prelude`].
pub mod account {
pub use frame_support::traits::{
AsEnsureOriginWithArg, ChangeMembers, EitherOfDiverse, InitializeMembers,
AsEnsureOriginWithArg, ChangeMembers, DisabledValidators, EitherOfDiverse, FindAuthor,
InitializeMembers,
};
pub use sp_runtime::traits::{IdentifyAccount, IdentityLookup};
}
Expand Down

0 comments on commit 85afcc5

Please sign in to comment.