Skip to content

Commit

Permalink
chore: feature gate sp-runtime in primitives
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <[email protected]>
  • Loading branch information
gregdhill committed Jul 21, 2023
1 parent 3550749 commit 874dca1
Show file tree
Hide file tree
Showing 18 changed files with 119 additions and 118 deletions.
4 changes: 1 addition & 3 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion crates/annuity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch =
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

reward = { path = "../reward", default-features = false }
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion crates/currency/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ parameter_type_with_key! {
impl orml_tokens::Config for Test {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type Amount = primitives::Amount;
type Amount = primitives::SignedBalance;
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = ExistentialDeposits;
Expand Down
2 changes: 0 additions & 2 deletions crates/escrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
std = [
Expand Down
2 changes: 0 additions & 2 deletions crates/farming/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
std = [
Expand Down
2 changes: 1 addition & 1 deletion crates/farming/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ parameter_type_with_key! {
impl orml_tokens::Config for Test {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type Amount = primitives::Amount;
type Amount = primitives::SignedBalance;
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = ExistentialDeposits;
Expand Down
3 changes: 0 additions & 3 deletions crates/fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ currency = { path = "../currency", features = ["testing-utils"] }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false }

# Parachain dependencies
primitives = { package = "interbtc-primitives", path = "../../primitives"}

[features]
default = ["std"]
std = [
Expand Down
1 change: 0 additions & 1 deletion crates/multi-transaction-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion crates/oracle/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ parameter_type_with_key! {
impl orml_tokens::Config for Test {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type Amount = primitives::Amount;
type Amount = primitives::SignedBalance;
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = ExistentialDeposits;
Expand Down
4 changes: 1 addition & 3 deletions crates/reward/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features =
scale-info = { version = "2.2.0", default-features = false, features = ["derive"] }

# Parachain dependencies
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false, features = ["substrate-compat"] }

# Substrate dependencies
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
Expand All @@ -31,8 +31,6 @@ rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
std = [
Expand Down
2 changes: 0 additions & 2 deletions crates/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
std = [
Expand Down
2 changes: 0 additions & 2 deletions crates/supply/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

[features]
default = ["std"]
std = [
Expand Down
2 changes: 1 addition & 1 deletion crates/traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ frame-support = { git = "https://github.com/paritytech/substrate.git", branch =
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", default-features = false }

# Parachain dependencies
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false, features = ["substrate-compat"] }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
Expand Down
8 changes: 3 additions & 5 deletions parachain/runtime/interlay/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl frame_system::Config for Runtime {
/// The hashing algorithm used.
type Hashing = BlakeTwo256;
/// The header type.
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Header = Header;
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
Expand Down Expand Up @@ -692,7 +692,7 @@ where
impl orml_tokens::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type Amount = primitives::Amount;
type Amount = primitives::SignedBalance;
type CurrencyId = CurrencyId;
type WeightInfo = weights::orml_tokens::WeightInfo<Runtime>;
type ExistentialDeposits = ExistentialDeposits;
Expand Down Expand Up @@ -1269,8 +1269,6 @@ construct_runtime! {
}
}

/// The address format for describing accounts.
pub type Address = AccountId;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
Expand All @@ -1290,7 +1288,7 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<AccountId, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
Expand Down
8 changes: 3 additions & 5 deletions parachain/runtime/kintsugi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl frame_system::Config for Runtime {
/// The hashing algorithm used.
type Hashing = BlakeTwo256;
/// The header type.
type Header = generic::Header<BlockNumber, BlakeTwo256>;
type Header = Header;
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
Expand Down Expand Up @@ -691,7 +691,7 @@ where
impl orml_tokens::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type Amount = primitives::Amount;
type Amount = primitives::SignedBalance;
type CurrencyId = CurrencyId;
type WeightInfo = weights::orml_tokens::WeightInfo<Runtime>;
type ExistentialDeposits = ExistentialDeposits;
Expand Down Expand Up @@ -1269,8 +1269,6 @@ construct_runtime! {
}
}

/// The address format for describing accounts.
pub type Address = AccountId;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
Expand All @@ -1290,7 +1288,7 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<AccountId, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
Expand Down
1 change: 1 addition & 0 deletions parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use sp_consensus_aura::{
sr25519::{AuthorityId as AuraId, AuthorityPair as AuraPair},
SlotDuration,
};
use sp_core::H256;
use sp_keystore::KeystorePtr;
use sp_runtime::traits::BlakeTwo256;
use std::{sync::Arc, time::Duration};
Expand Down
18 changes: 9 additions & 9 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ version = "1.2.0"
bstringify = "0.1.2"
serde = { version = "1.0.130", optional = true }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
primitive-types = { version = "0.12.1", default-features = false, features = ["codec", "scale-info"] }
scale-info = { version = "2.2.0", default-features = false, features = ["derive"] }

sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.31", default-features = false }
scale-decode = { version = "0.7.0", default-features = false, features = ["derive"], optional = true }
scale-encode = { version = "0.3.0", default-features = false, features = ["derive"], optional = true }

# Substrate dependencies
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false, optional = true }

# Parachain dependencies
bitcoin = { path = "../crates/bitcoin", default-features = false }

[features]
default = ["std"]
default = ["std", "substrate-compat"]
std = [
"serde",
"codec/std",
"primitive-types/std",
"primitive-types/serde",
"scale-decode",
"scale-encode",

"sp-core/std",
"sp-std/std",
"sp-runtime/std",
"sp-runtime?/std",

"bitcoin/std",
]
runtime-benchmarks = []
substrate-compat = ["sp-runtime"]
Loading

0 comments on commit 874dca1

Please sign in to comment.