diff --git a/substrate/frame/authorship/src/lib.rs b/substrate/frame/authorship/src/lib.rs index 7968ebb370e2..2f4aea6db429 100644 --- a/substrate/frame/authorship/src/lib.rs +++ b/substrate/frame/authorship/src/lib.rs @@ -94,9 +94,12 @@ mod tests { use super::*; use crate as pallet_authorship; use codec::{Decode, Encode}; - use frame::testing_prelude::*; + use frame::{ + deps::sp_runtime::{testing::Header, traits::Header as _}, + testing_prelude::*, + }; - type Block = frame_system::mocking::MockBlock; + type Block = MockBlock; construct_runtime!( pub enum Test @@ -135,7 +138,7 @@ mod tests { } } - fn seal_header(mut header: HeaderTest, author: u64) -> HeaderTest { + fn seal_header(mut header: Header, author: u64) -> Header { { let digest = header.digest_mut(); digest.logs.push(DigestItem::PreRuntime(TEST_ID, author.encode())); @@ -145,8 +148,8 @@ mod tests { header } - fn create_header(number: u64, parent_hash: H256, state_root: H256) -> HeaderTest { - HeaderTest::new(number, Default::default(), state_root, parent_hash, Default::default()) + fn create_header(number: u64, parent_hash: H256, state_root: H256) -> Header { + Header::new(number, Default::default(), state_root, parent_hash, Default::default()) } fn new_test_ext() -> frame::deps::sp_io::TestExternalities { diff --git a/substrate/frame/src/lib.rs b/substrate/frame/src/lib.rs index 0e41f77d6bee..ccda562e294a 100644 --- a/substrate/frame/src/lib.rs +++ b/substrate/frame/src/lib.rs @@ -219,9 +219,6 @@ pub mod prelude { /// All account management related things. pub use super::account::*; - /// All block production related things. - pub use super::block::*; - /// Runtime traits #[doc(no_inline)] pub use sp_runtime::traits::{ @@ -232,6 +229,8 @@ pub mod prelude { /// Other error/result types for runtime #[doc(no_inline)] pub use sp_runtime::{DispatchErrorWithPostInfo, DispatchResultWithInfo, TokenError}; + + pub use sp_runtime::ConsensusEngineId; } #[cfg(any(feature = "try-runtime", test))] @@ -323,6 +322,8 @@ pub mod testing_prelude { pub use sp_io::TestExternalities; pub use sp_io::TestExternalities as TestState; + + pub use sp_runtime::DigestItem; } /// All of the types and tools needed to build FRAME-based runtimes. @@ -548,15 +549,6 @@ pub mod account { pub use sp_runtime::traits::{IdentifyAccount, IdentityLookup}; } -pub mod block { - pub use frame_support::ConsensusEngineId; - pub use frame_system::limits; - pub use sp_runtime::{generic::DigestItem, traits::Header}; - - #[cfg(feature = "std")] - pub use sp_runtime::testing::Header as HeaderTest; -} - /// Access to all of the dependencies of this crate. In case the prelude re-exports are not enough, /// this module can be used. ///