Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed May 16, 2024
1 parent 45ca1c4 commit 45b3f11
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 39 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }

pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
staging-parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }

# Polkadot
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
Expand Down Expand Up @@ -379,7 +379,6 @@ sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "r
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" }

#sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.7.2" }
# Check issue: https://github.com/paritytech/arkworks-substrate/issues/9
[patch."https://github.com/paritytech/polkadot-sdk"]
sp-crypto-ec-utils = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.7.2" }
Expand Down
6 changes: 3 additions & 3 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn centrifuge_genesis(
)],
},
vesting: Default::default(),
parachain_info: centrifuge_runtime::ParachainInfoConfig {
staging_parachain_info: centrifuge_runtime::ParachainInfoConfig {
parachain_id: id,
..Default::default()
},
Expand Down Expand Up @@ -532,7 +532,7 @@ fn altair_genesis(
)],
},
vesting: Default::default(),
parachain_info: altair_runtime::ParachainInfoConfig {
staging_parachain_info: altair_runtime::ParachainInfoConfig {
parachain_id: id,
..Default::default()
},
Expand Down Expand Up @@ -685,7 +685,7 @@ fn development_genesis(
sudo: development_runtime::SudoConfig {
key: Some(root_key),
},
parachain_info: development_runtime::ParachainInfoConfig {
staging_parachain_info: development_runtime::ParachainInfoConfig {
parachain_id: id,
..Default::default()
},
Expand Down
2 changes: 1 addition & 1 deletion pallets/liquidity-pools/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn xcm_router_contract() -> Contract {
internal_type: None,
}],
outputs: vec![],
constant: false,
constant: Some(false),
state_mutability: Default::default(),
}],
);
Expand Down
6 changes: 3 additions & 3 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedDmpWeight = ReservedDmpWeight;
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

impl parachain_info::Config for Runtime {}
impl staging_parachain_info::Config for Runtime {}

parameter_types! {
pub const MinimumPeriod: Millis = SLOT_DURATION / 2;
Expand Down Expand Up @@ -1915,7 +1915,7 @@ construct_runtime!(
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config<T>, Storage, Inherent, Event<T>} = 1,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config<T>} = 4,
ParachainInfo: staging_parachain_info::{Pallet, Storage, Config<T>} = 4,

// money stuff
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 20,
Expand Down
6 changes: 3 additions & 3 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedDmpWeight = ReservedDmpWeight;
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

Expand Down Expand Up @@ -426,7 +426,7 @@ impl orml_asset_registry::Config for Runtime {
// case, pallet-pools and democracy
type WeightInfo = ();
}
impl parachain_info::Config for Runtime {}
impl staging_parachain_info::Config for Runtime {}

parameter_types! {
pub const MinimumPeriod: Millis = SLOT_DURATION / 2;
Expand Down Expand Up @@ -2028,7 +2028,7 @@ construct_runtime!(
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config<T>, Storage, Inherent, Event<T>} = 1,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config<T>} = 4,
ParachainInfo: staging_parachain_info::{Pallet, Storage, Config<T>} = 4,

// money stuff
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 20,
Expand Down
15 changes: 3 additions & 12 deletions runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pallet-utility = { workspace = true }
pallet-vesting = { workspace = true }
pallet-xcm = { workspace = true }
pallet-xcm-transactor = { workspace = true }
parachain-info = { workspace = true }
staging-parachain-info = { workspace = true }

# Optionals for benchmarking
frame-benchmarking = { workspace = true, optional = true }
Expand Down Expand Up @@ -150,15 +150,6 @@ std = [
"pallet-evm-precompile-sha3fips/std",
"pallet-evm-precompile-simple/std",
"precompile-utils/std",
"pallet-evm/std",
"pallet-investments/std",
"pallet-liquidity-pools-gateway/std",
"pallet-liquidity-pools/std",
"pallet-loans/std",
"pallet-pool-system/std",
"pallet-restricted-tokens/std",
"pallet-treasury/std",
"parachain-info/std",
"polkadot-parachain-primitives/std",
"scale-info/std",
"serde/std",
Expand Down Expand Up @@ -246,7 +237,7 @@ std = [
"pallet-vesting/std",
"pallet-xcm/std",
"pallet-xcm-transactor/std",
"parachain-info/std",
"staging-parachain-info/std",
]
runtime-benchmarks = [
# Substrate related
Expand Down Expand Up @@ -397,7 +388,7 @@ try-runtime = [
"pallet-vesting/try-runtime",
"pallet-xcm/try-runtime",
"pallet-xcm-transactor/try-runtime",
"parachain-info/try-runtime",
"staging-parachain-info/try-runtime",
]
on-chain-release-build = [
"sp-api/disable-logging",
Expand Down
5 changes: 3 additions & 2 deletions runtime/common/src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ use sp_runtime::traits::AccountIdConversion;

use crate::account_conversion::AccountConverter;

pub fn get_gateway_account<T: pallet_evm_chain_id::Config + parachain_info::Config>() -> AccountId {
pub fn get_gateway_account<T: pallet_evm_chain_id::Config + staging_parachain_info::Config>(
) -> AccountId {
let sender_account: AccountId =
Sibling::from(parachain_info::Pallet::<T>::get()).into_account_truncating();
Sibling::from(staging_parachain_info::Pallet::<T>::get()).into_account_truncating();

let truncated_sender_account =
H160::from_slice(&<AccountId32 as AsRef<[u8; 32]>>::as_ref(&sender_account)[0..20]);
Expand Down
12 changes: 6 additions & 6 deletions runtime/common/src/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ pub struct CurrencyIdConvert<T>(PhantomData<T>);
impl<T> MaybeEquivalence<MultiLocation, CurrencyId> for CurrencyIdConvert<T>
where
T: orml_asset_registry::Config<AssetId = CurrencyId, CustomMetadata = CustomMetadata>
+ parachain_info::Config,
+ staging_parachain_info::Config,
{
fn convert(location: &MultiLocation) -> Option<CurrencyId> {
let para_id = parachain_info::Pallet::<T>::parachain_id();
let para_id = staging_parachain_info::Pallet::<T>::parachain_id();
let unanchored_location = match location {
MultiLocation {
parents: 0,
Expand Down Expand Up @@ -191,7 +191,7 @@ where
impl<T> Convert<CurrencyId, Option<MultiLocation>> for CurrencyIdConvert<T>
where
T: orml_asset_registry::Config<AssetId = CurrencyId, CustomMetadata = CustomMetadata>
+ parachain_info::Config,
+ staging_parachain_info::Config,
{
fn convert(id: CurrencyId) -> Option<MultiLocation> {
<Self as MaybeEquivalence<_, _>>::convert_back(&id)
Expand All @@ -205,7 +205,7 @@ where
impl<T> Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert<T>
where
T: orml_asset_registry::Config<AssetId = CurrencyId, CustomMetadata = CustomMetadata>
+ parachain_info::Config,
+ staging_parachain_info::Config,
{
fn convert(location: MultiLocation) -> Option<CurrencyId> {
<Self as MaybeEquivalence<_, _>>::convert(&location)
Expand All @@ -215,7 +215,7 @@ where
impl<T> Convert<MultiAsset, Option<CurrencyId>> for CurrencyIdConvert<T>
where
T: orml_asset_registry::Config<AssetId = CurrencyId, CustomMetadata = CustomMetadata>
+ parachain_info::Config,
+ staging_parachain_info::Config,
{
fn convert(asset: MultiAsset) -> Option<CurrencyId> {
if let MultiAsset {
Expand All @@ -234,7 +234,7 @@ pub struct ToTreasury<T>(PhantomData<T>);
impl<T> TakeRevenue for ToTreasury<T>
where
T: orml_asset_registry::Config<AssetId = CurrencyId, CustomMetadata = CustomMetadata>
+ parachain_info::Config
+ staging_parachain_info::Config
+ pallet_restricted_tokens::Config<CurrencyId = CurrencyId, Balance = Balance>,
{
fn take_revenue(revenue: MultiAsset) {
Expand Down
6 changes: 3 additions & 3 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedDmpWeight = ReservedDmpWeight;
type ReservedXcmpWeight = ReservedXcmpWeight;
type RuntimeEvent = RuntimeEvent;
type SelfParaId = parachain_info::Pallet<Runtime>;
type SelfParaId = staging_parachain_info::Pallet<Runtime>;
type XcmpMessageHandler = XcmpQueue;
}

impl parachain_info::Config for Runtime {}
impl staging_parachain_info::Config for Runtime {}

parameter_types! {
pub const MinimumPeriod: Millis = SLOT_DURATION / 2;
Expand Down Expand Up @@ -2006,7 +2006,7 @@ construct_runtime!(
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config<T>, Storage, Inherent, Event<T>} = 1,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config<T>} = 4,
ParachainInfo: staging_parachain_info::{Pallet, Storage, Config<T>} = 4,

// money stuff
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn remote_account_on_relay<T: Runtime>() {
T::Api::conversion_of(MultiLocation::new(
0,
X2(
Parachain(parachain_info::Pallet::<T>::get().into()),
Parachain(staging_parachain_info::Pallet::<T>::get().into()),
AccountId32 {
id: KEY_32,
network: Some(NetworkId::ByGenesis(
Expand Down Expand Up @@ -218,7 +218,7 @@ fn remote_account_on_sibling<T: Runtime>() {
T::Api::conversion_of(MultiLocation::new(
1,
X2(
Parachain(parachain_info::Pallet::<T>::get().into()),
Parachain(staging_parachain_info::Pallet::<T>::get().into()),
AccountId32 {
id: KEY_32,
network: Some(NetworkId::ByGenesis(
Expand Down
2 changes: 1 addition & 1 deletion runtime/integration-tests/src/generic/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub trait Runtime:
Balance = Balance,
NativeFungible = pallet_balances::Pallet<Self>,
> + cumulus_pallet_parachain_system::Config
+ parachain_info::Config
+ staging_parachain_info::Config
+ pallet_oracle_feed::Config<OracleKey = OracleKey, OracleValue = Ratio>
+ pallet_oracle_collection::Config<
OracleKey = OracleKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pub trait FudgeHandle<T: Runtime> {
.expect("ESSENTIAL: Storage can be inserted");
state
.insert_storage(
parachain_info::GenesisConfig::<T> {
staging_parachain_info::GenesisConfig::<T> {
_config: Default::default(),
parachain_id: para_id,
}
Expand Down

0 comments on commit 45b3f11

Please sign in to comment.