Skip to content

Commit

Permalink
sp-application-crypto to umbrella
Browse files Browse the repository at this point in the history
  • Loading branch information
runcomet committed Jan 9, 2025
1 parent eb483ce commit 79d15d6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions substrate/frame/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ frame-system = { workspace = true }

# primitive types used for developing FRAME runtimes.
sp-api = { optional = true, workspace = true }
sp-application-crypto = { optional = true, workspace = true }
sp-block-builder = { optional = true, workspace = true }
sp-consensus-aura = { optional = true, workspace = true }
sp-consensus-grandpa = { optional = true, workspace = true }
Expand Down Expand Up @@ -72,6 +73,7 @@ runtime = [
"frame-executive",
"frame-system-rpc-runtime-api",
"sp-api",
"sp-application-crypto",
"sp-block-builder",
"sp-consensus-aura",
"sp-consensus-grandpa",
Expand All @@ -96,6 +98,7 @@ std = [
"log/std",
"scale-info/std",
"sp-api?/std",
"sp-application-crypto/std",
"sp-arithmetic/std",
"sp-block-builder?/std",
"sp-consensus-aura?/std",
Expand Down
3 changes: 0 additions & 3 deletions substrate/frame/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ frame = { workspace = true, features = ["experimental", "runtime"] }
pallet-session = { features = [
"historical",
], workspace = true }
scale-info = { features = ["derive"], workspace = true }
sp-application-crypto = { workspace = true }
sp-authority-discovery = { workspace = true }

[features]
Expand All @@ -35,7 +33,6 @@ std = [
"frame/std",
"pallet-session/std",
"scale-info/std",
"sp-application-crypto/std",
"sp-authority-discovery/std",
]
try-runtime = [
Expand Down
10 changes: 3 additions & 7 deletions substrate/frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
extern crate alloc;

use alloc::vec::Vec;
use frame::{
prelude::*,
traits::{Get, OneSessionHandler},
};
use frame::prelude::*;
use sp_authority_discovery::AuthorityId;

pub use pallet::*;
Expand Down Expand Up @@ -170,11 +167,10 @@ mod tests {
use super::*;
use crate as pallet_authority_discovery;
use alloc::vec;
use frame::testing_prelude::*
use sp_application_crypto::Pair;
use frame::{testing_prelude::*, traits::OpaqueKeys};
use sp_authority_discovery::AuthorityPair;

type Block = frame_system::mocking::MockBlock<Test>;
type Block = MockBlock<Test>;

construct_runtime!(
pub enum Test
Expand Down
28 changes: 24 additions & 4 deletions substrate/frame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,18 @@ pub mod prelude {
pub use super::derive::*;

/// All hashing related things
pub use super::hashing::*;
pub use super::cryptography::*;

/// All arithmetic types and traits used for safe math.
pub use super::arithmetic::*;

/// All account management related things.
pub use super::account::*;

/// Runtime traits
#[doc(no_inline)]
pub use sp_runtime::traits::{
BlockNumberProvider, Bounded, Convert, DispatchInfoOf, Dispatchable, ReduceBy,
BlockNumberProvider, Bounded, Convert, ConvertInto, DispatchInfoOf, Dispatchable, ReduceBy,
ReplaceWithDefault, SaturatedConversion, Saturating, StaticLookup, TrailingZeroInput,
};

Expand Down Expand Up @@ -530,6 +533,17 @@ pub mod traits {
pub use sp_runtime::traits::*;
}

/// All account management related traits.
///
/// This is already part of the [`prelude`].
pub mod account {
pub use frame_support::traits::{
AsEnsureOriginWithArg, ChangeMembers, EitherOfDiverse, FindAuthor, InitializeMembers,
};
pub use sp_application_crypto::{KeyTypeId, Pair};
pub use sp_runtime::traits::{IdentifyAccount, IdentityLookup};
}

/// The arithmetic types used for safe math.
///
/// This is already part of the [`prelude`].
Expand All @@ -551,8 +565,12 @@ pub mod derive {
pub use sp_runtime::RuntimeDebug;
}

pub mod hashing {
pub use sp_core::{hashing::*, H160, H256, H512, U256, U512};
pub mod cryptography {
pub use sp_core::{
crypto::{VrfPublic, VrfSecret, Wraps},
hashing::*,
Pair, H160, H256, H512, U256, U512,
};
pub use sp_runtime::traits::{BlakeTwo256, Hash, Keccak256};
}

Expand Down Expand Up @@ -582,6 +600,8 @@ pub mod deps {
#[cfg(feature = "runtime")]
pub use sp_api;
#[cfg(feature = "runtime")]
pub use sp_application_crypto;
#[cfg(feature = "runtime")]
pub use sp_block_builder;
#[cfg(feature = "runtime")]
pub use sp_consensus_aura;
Expand Down

0 comments on commit 79d15d6

Please sign in to comment.