Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
More sc-service config reexports (#8887)
Browse files Browse the repository at this point in the history
* Reexport ExecutionStrategies and ExecutionStrategy

* Reexport more of the network

* Reexport the ExecutionStrategy as it's used within ExecutionStrategies
  • Loading branch information
MOZGIII authored and KiChjang committed May 28, 2021
1 parent 27cc30e commit d2927cb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
3 changes: 2 additions & 1 deletion client/api/src/execution_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ use sp_runtime::{
generic::BlockId,
traits,
};
use sp_state_machine::{ExecutionStrategy, ExecutionManager, DefaultHandler};
use sp_state_machine::{ExecutionManager, DefaultHandler};
pub use sp_state_machine::ExecutionStrategy;
use sp_externalities::Extensions;
use parking_lot::RwLock;

Expand Down
8 changes: 6 additions & 2 deletions client/service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ pub use sc_client_db::{
KeepBlocks, TransactionStorageMode
};
pub use sc_network::Multiaddr;
pub use sc_network::config::{ExtTransport, MultiaddrWithPeerId, NetworkConfiguration, Role, NodeKeyConfig};
pub use sc_network::config::{
ExtTransport, MultiaddrWithPeerId, NetworkConfiguration, Role, NodeKeyConfig,
SetConfig, NonDefaultSetConfig, TransportConfig,
RequestResponseConfig, IncomingRequest, OutgoingResponse,
};
pub use sc_executor::WasmExecutionMethod;
use sc_client_api::execution_extensions::ExecutionStrategies;
pub use sc_client_api::execution_extensions::{ExecutionStrategies, ExecutionStrategy};

use std::{io, future::Future, path::{PathBuf, Path}, pin::Pin, net::SocketAddr, sync::Arc};
pub use sc_transaction_pool::txpool::Options as TransactionPoolOptions;
Expand Down
30 changes: 29 additions & 1 deletion frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,34 @@ impl TypeId for PalletId {
const TYPE_ID: [u8; 4] = *b"modl";
}

/// Enum representing pallet parts. Used for declaring the parts exported by the pallet during
/// macro expansion. `Module`/`Pallet` does not appear as a variant here because it is mandatory
/// for every pallet.
#[derive(Clone, Copy, Eq, PartialEq, Encode, Decode)]
pub enum PalletPart {
Call,
Config,
Event,
Inherent,
Origin,
Storage,
ValidateUnsigned,
}

impl sp_std::fmt::Display for PalletPart {
fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result {
write!(f, "{}", match self {
Self::Call => "Call",
Self::Config => "Config",
Self::Event => "Event",
Self::Inherent => "Inherent",
Self::Origin => "Origin",
Self::Storage => "Storage",
Self::ValidateUnsigned => "ValidateUnsigned",
})
}
}

/// Generate a new type alias for [`storage::types::StorageValue`],
/// [`storage::types::StorageMap`] and [`storage::types::StorageDoubleMap`].
///
Expand Down Expand Up @@ -1236,7 +1264,7 @@ pub mod pallet_prelude {
pub use crate::{
EqNoBound, PartialEqNoBound, RuntimeDebugNoBound, DebugNoBound, CloneNoBound, Twox256,
Twox128, Blake2_256, Blake2_128, Identity, Twox64Concat, Blake2_128Concat, ensure,
RuntimeDebug, storage,
RuntimeDebug, PalletPart, storage,
traits::{
Get, Hooks, IsType, GetPalletVersion, EnsureOrigin, PalletInfoAccess, StorageInfoTrait,
ConstU32, GetDefault,
Expand Down

0 comments on commit d2927cb

Please sign in to comment.