Skip to content
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
1 change: 0 additions & 1 deletion Cargo.lock

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

6 changes: 3 additions & 3 deletions integration-tests/src/kusama_cross_chain_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn transfer_from_relay_chain() {
Bifrost::execute_with(|| {
assert_eq!(
Tokens::free_balance(RelayCurrencyId::get(), &AccountId::from(BOB)),
999_952_000_000
999_936_000_000
);
});
}
Expand All @@ -58,11 +58,11 @@ fn transfer_to_relay_chain() {
1,
X1(Junction::AccountId32 { id: BOB, network: NetworkId::Any })
)),
3_000_000_000
4_000_000_000
));
});

KusamaNet::execute_with(|| {
assert_eq!(kusama_runtime::Balances::free_balance(&AccountId::from(BOB)), 999_920_000_005);
assert_eq!(kusama_runtime::Balances::free_balance(&AccountId::from(BOB)), 999_893_333_340);
});
}
6 changes: 6 additions & 0 deletions integration-tests/src/kusama_test_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ pub fn kusama_ext() -> sp_io::TestExternalities {
.assimilate_storage(&mut t)
.unwrap();

<pallet_xcm::GenesisConfig as GenesisBuild<Runtime>>::assimilate_storage(
&pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) },
&mut t,
)
.unwrap();

let mut ext = sp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext
Expand Down
5 changes: 3 additions & 2 deletions node/service/src/chain_spec/asgard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use asgard_runtime::{
constants::{currency::DOLLARS, time::DAYS},
AccountId, AuraId, Balance, BalancesConfig, BancorConfig, BlockNumber, CollatorSelectionConfig,
CouncilConfig, DemocracyConfig, GenesisConfig, IndicesConfig, MinterRewardConfig,
ParachainInfoConfig, SessionConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig,
TokensConfig, VestingConfig, VtokenMintConfig, WASM_BINARY,
ParachainInfoConfig, PolkadotXcmConfig, SessionConfig, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, TokensConfig, VestingConfig, VtokenMintConfig, WASM_BINARY,
};
use cumulus_primitives_core::ParaId;
use frame_benchmarking::{account, whitelisted_caller};
Expand Down Expand Up @@ -123,6 +123,7 @@ pub fn asgard_genesis(
(CurrencyId::Token(TokenSymbol::KSM), 7 * DAYS),
],
},
polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2) },
}
}

Expand Down
6 changes: 4 additions & 2 deletions node/service/src/chain_spec/bifrost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ use std::{
use bifrost_runtime::{
constants::currency::DOLLARS, AccountId, AuraId, Balance, BalancesConfig, BlockNumber,
CollatorSelectionConfig, CouncilConfig, CouncilMembershipConfig, DemocracyConfig,
GenesisConfig, IndicesConfig, ParachainInfoConfig, SessionConfig, SystemConfig,
TechnicalCommitteeConfig, TechnicalMembershipConfig, TokensConfig, VestingConfig, WASM_BINARY,
GenesisConfig, IndicesConfig, ParachainInfoConfig, PolkadotXcmConfig, SessionConfig,
SystemConfig, TechnicalCommitteeConfig, TechnicalMembershipConfig, TokensConfig, VestingConfig,
WASM_BINARY,
};
use cumulus_primitives_core::ParaId;
use frame_benchmarking::{account, whitelisted_caller};
Expand Down Expand Up @@ -104,6 +105,7 @@ pub fn bifrost_genesis(
parachain_system: Default::default(),
vesting: VestingConfig { vesting: vestings },
tokens: TokensConfig { balances: tokens },
polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2) },
}
}

Expand Down
6 changes: 0 additions & 6 deletions pallets/salp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "pol
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11", default-features = false }
xcm-support = { path = "../../xcm-support", default-features = false }
orml-traits = { version = "0.4.1-dev", default-features = false }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11", default-features = false }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11", default-features = false }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11", default-features = false }

[dev-dependencies]
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.11" }
Expand Down Expand Up @@ -53,13 +50,10 @@ std = [
"orml-traits/std",
"xcm/std",
"xcm-support/std",
"polkadot-parachain/std",
]

runtime-benchmarks = [
"frame-benchmarking",
"sp-runtime/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
]
22 changes: 14 additions & 8 deletions runtime/asgard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ use sp_runtime::traits::ConvertInto;
use static_assertions::const_assert;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible,
FixedWeightBounds, IsConcrete, LocationInverter, ParentAsSuperuser, ParentIsDefault,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue,
TakeWeightCredit,
};
Expand Down Expand Up @@ -774,7 +775,12 @@ match_type! {
};
}

pub type Barrier = (TakeWeightCredit, AllowTopLevelPaidExecutionFrom<Everything>);
pub type Barrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
AllowKnownQueryResponses<PolkadotXcm>,
AllowSubscriptionsFrom<Everything>,
);

pub type BifrostAssetTransactor = MultiCurrencyAdapter<
Currencies,
Expand Down Expand Up @@ -867,7 +873,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, AnyNetwo
/// queues.
pub type XcmRouter = (
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
Expand Down Expand Up @@ -1476,7 +1482,7 @@ construct_runtime! {

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 40,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 41,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config} = 41,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 42,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 43,

Expand Down Expand Up @@ -1873,8 +1879,8 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn on_runtime_upgrade() -> Weight {
log::info!("Asgard `on_runtime_upgrade`...");

RuntimeBlockWeights::get().max_block
let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2));
RocksDbWeight::get().writes(1);
}
}

Expand Down
21 changes: 14 additions & 7 deletions runtime/bifrost/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ use sp_arithmetic::Percent;
use sp_runtime::traits::ConvertInto;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
FixedRateOfFungible, FixedWeightBounds, IsConcrete, LocationInverter, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible,
FixedWeightBounds, IsConcrete, LocationInverter, ParentAsSuperuser, ParentIsDefault,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue,
TakeWeightCredit,
};
Expand Down Expand Up @@ -683,7 +684,12 @@ match_type! {
};
}

pub type Barrier = (TakeWeightCredit, AllowTopLevelPaidExecutionFrom<Everything>);
pub type Barrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
AllowKnownQueryResponses<PolkadotXcm>,
AllowSubscriptionsFrom<Everything>,
);

pub type BifrostAssetTransactor = MultiCurrencyAdapter<
Currencies,
Expand Down Expand Up @@ -776,7 +782,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNet
/// queues.
pub type XcmRouter = (
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
Expand Down Expand Up @@ -1324,7 +1330,7 @@ construct_runtime! {

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 40,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 41,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config} = 41,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 42,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 43,

Expand Down Expand Up @@ -1674,7 +1680,8 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn on_runtime_upgrade() -> Weight {
log::info!("Bifrost `on_runtime_upgrade`...");
RuntimeBlockWeights::get().max_block
let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2));
RocksDbWeight::get().writes(1)
}
}

Expand Down