Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
runcomet committed Dec 29, 2024
1 parent 24c60e8 commit 6420493
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
13 changes: 8 additions & 5 deletions substrate/frame/authorship/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Test>;
type Block = MockBlock<Test>;

construct_runtime!(
pub enum Test
Expand Down Expand Up @@ -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()));
Expand All @@ -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 {
Expand Down
16 changes: 4 additions & 12 deletions substrate/frame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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))]
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 6420493

Please sign in to comment.