-
Notifications
You must be signed in to change notification settings - Fork 372
Align BridgeHub runtimes with other SP runtimes + reused test for teleport native tokens + some nits #2449
Align BridgeHub runtimes with other SP runtimes + reused test for teleport native tokens + some nits #2449
Changes from 3 commits
97ae18a
b807bc6
85e6c72
ccf7da4
b24f9bc
044c3c0
0fc0136
5c125db
b01d022
78ab2cd
e5692b3
0829744
27d3951
cb2d352
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,17 +96,16 @@ pub type XcmOriginToTransactDispatchOrigin = ( | |
| // transaction from the Root origin. | ||
| ParentAsSuperuser<RuntimeOrigin>, | ||
| // Native signed account converter; this just converts an `AccountId32` origin into a normal | ||
| // `Origin::Signed` origin of the same 32-byte value. | ||
| // `RuntimeOrigin::Signed` origin of the same 32-byte value. | ||
| SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>, | ||
| // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. | ||
| XcmPassthrough<RuntimeOrigin>, | ||
| ); | ||
|
|
||
| match_types! { | ||
| // TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 | ||
| pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = { | ||
| pub type ParentOrParentsPlurality: impl Contains<MultiLocation> = { | ||
| MultiLocation { parents: 1, interior: Here } | | ||
| MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } | ||
| MultiLocation { parents: 1, interior: X1(Plurality { .. }) } | ||
| }; | ||
| pub type ParentOrSiblings: impl Contains<MultiLocation> = { | ||
| MultiLocation { parents: 1, interior: Here } | | ||
|
|
@@ -165,10 +164,10 @@ pub type Barrier = DenyThenTry< | |
| AllowKnownQueryResponses<PolkadotXcm>, | ||
| WithComputedOrigin< | ||
| ( | ||
| // Allow anything to pay for execution. | ||
| // If the message is one that immediately attemps to pay for execution, then allow it. | ||
| AllowTopLevelPaidExecutionFrom<Everything>, | ||
| // Parent and its exec plurality get free execution. | ||
| AllowExplicitUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>, | ||
| // Parent and its plurality (i.e. governance bodies) gets free execution. | ||
bkontur marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| AllowExplicitUnpaidExecutionFrom<ParentOrParentsPlurality>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did it according to statemine, but I think it is related to the fact that Kusama does not have Collectives parachain, polkadot's
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and iiuc this is one of future plans to bring |
||
| // Subscriptions for version tracking are OK. | ||
| AllowSubscriptionsFrom<ParentOrSiblings>, | ||
| ), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // Copyright 2023 Parity Technologies (UK) Ltd. | ||
| // This file is part of Cumulus. | ||
|
|
||
| // Cumulus is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
|
|
||
| // Cumulus is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
|
|
||
| // You should have received a copy of the GNU General Public License | ||
| // along with Cumulus. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| pub use bridge_hub_kusama_runtime::{ | ||
| constants::fee::WeightToFee, xcm_config::XcmConfig, Balances, ExistentialDeposit, | ||
| ParachainSystem, PolkadotXcm, Runtime, RuntimeEvent, SessionKeys, | ||
| }; | ||
| use codec::Decode; | ||
| use frame_support::parameter_types; | ||
| use parachains_common::{AccountId, AuraId}; | ||
|
|
||
| const ALICE: [u8; 32] = [1u8; 32]; | ||
|
|
||
| parameter_types! { | ||
| pub CheckingAccount: AccountId = PolkadotXcm::check_account(); | ||
| } | ||
|
|
||
| bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( | ||
| Runtime, | ||
| XcmConfig, | ||
| CheckingAccount, | ||
| WeightToFee, | ||
| ParachainSystem, | ||
| bridge_hub_test_utils::CollatorSessionKeys::new( | ||
| AccountId::from(ALICE), | ||
| AccountId::from(ALICE), | ||
| SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) } | ||
| ), | ||
| ExistentialDeposit::get(), | ||
| Box::new(|runtime_event_encoded: Vec<u8>| { | ||
| match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { | ||
| Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event), | ||
| _ => None, | ||
| } | ||
| }), | ||
| Box::new(|runtime_event_encoded: Vec<u8>| { | ||
| match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { | ||
| Ok(RuntimeEvent::XcmpQueue(event)) => Some(event), | ||
| _ => None, | ||
| } | ||
| }) | ||
| ); |
Uh oh!
There was an error while loading. Please reload this page.