Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pallet-staking and pallet-contracts dependencies optional #522

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ std = [
jsonrpsee-client = ["std", "jsonrpsee", "futures"]
tungstenite-client = ["std", "tungstenite"]
ws-client = ["std", "ws"]
staking-xt = ["std"]
staking-xt = ["std", "ac-primitives/staking-xt"]
contracts-xt = ["std", "ac-primitives/contracts-xt"]
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "ma
sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "master" }

# local deps
substrate-api-client = { path = "..", features = ["tungstenite-client", "ws-client", "staking-xt"] }
substrate-api-client = { path = "..", features = ["tungstenite-client", "ws-client", "staking-xt", "contracts-xt"] }
4 changes: 2 additions & 2 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ std = [
"frame-system",
"pallet-assets",
"pallet-balances",
"pallet-contracts",
"pallet-staking",
]
staking-xt = ["std", "pallet-staking"]
contracts-xt = ["std", "pallet-contracts"]
2 changes: 1 addition & 1 deletion primitives/src/pallet_traits/pallet_contracts_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub trait ContractsConfig: FrameSystemConfig {
type MaxStorageKeyLen: Get<u32>;
}

#[cfg(feature = "std")]
#[cfg(feature = "contracts-xt")]
impl<T> ContractsConfig for T
where
T: pallet_contracts::Config,
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/pallet_traits/pallet_staking_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub trait StakingConfig: FrameSystemConfig {
type WeightInfo;
}

#[cfg(feature = "std")]
#[cfg(feature = "staking-xt")]
impl<T> StakingConfig for T
where
T: pallet_staking::Config,
Expand Down
2 changes: 2 additions & 0 deletions src/extrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
//! Offers some predefined extrinsics for common runtime modules.

pub use balances::BalancesExtrinsics;
#[cfg(feature = "contracts-xt")]
pub use contracts::ContractsExtrinsics;
#[cfg(feature = "staking-xt")]
pub use staking::StakingExtrinsics;
pub use utility::UtilityExtrinsics;

pub mod balances;
#[cfg(feature = "contracts-xt")]
pub mod contracts;
pub mod offline_extrinsic;
#[cfg(feature = "staking-xt")]
Expand Down
1 change: 1 addition & 0 deletions testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ substrate-api-client = { path = "..", features = [
"tungstenite-client",
"ws-client",
"staking-xt",
"contracts-xt",
] }

[features]
Expand Down