Skip to content

Commit

Permalink
set safe xcm version to 2 (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
GopherJ authored Oct 25, 2021
1 parent 5fb7a02 commit f23a5ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
15 changes: 11 additions & 4 deletions runtime/heiko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod weights;
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
dispatch::Weight,
traits::{fungibles::Mutate, Contains, Everything, InstanceFilter, Nothing},
traits::{fungibles::Mutate, Contains, Everything, InstanceFilter, Nothing, OnRuntimeUpgrade},
PalletId,
};
use orml_traits::{DataProvider, DataProviderExtended};
Expand Down Expand Up @@ -770,8 +770,7 @@ impl pallet_utility::Config for Runtime {
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
#[allow(unused_parens)]
pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>);
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
Expand Down Expand Up @@ -1403,9 +1402,17 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
(),
SetSafeXcmVersion,
>;

pub struct SetSafeXcmVersion;
impl OnRuntimeUpgrade for SetSafeXcmVersion {
fn on_runtime_upgrade() -> u64 {
let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2));
RocksDbWeight::get().writes(1)
}
}

impl_runtime_apis! {
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> sp_consensus_aura::SlotDuration {
Expand Down
3 changes: 1 addition & 2 deletions runtime/parallel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,7 @@ impl pallet_utility::Config for Runtime {
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
#[allow(unused_parens)]
pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>);
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
Expand Down
3 changes: 1 addition & 2 deletions runtime/vanilla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,7 @@ impl pallet_utility::Config for Runtime {
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
#[allow(unused_parens)]
pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>);
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
Expand Down

0 comments on commit f23a5ad

Please sign in to comment.