Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
735c299
Integration emulated governance tests (with `authorize_upgrade`) init
bkontur Mar 17, 2025
9e33eda
Updated TODOs to check later
bkontur Mar 17, 2025
28411c3
[Governance tests] can_authorize_upgrade_for_system_chains initial im…
karolk91 Mar 21, 2025
66d4cea
Governance tests - continuation (#10)
karolk91 Mar 27, 2025
306c2ff
[AHM Gov] AssetHub as Superuser on Polkadot relay - utils & config (#12)
karolk91 Apr 10, 2025
ffe432f
Merge branch 'dev-asset-hub-migration' into bko-ahm-governance-root
bkontur Apr 10, 2025
4d6593f
Merge remote-tracking branch 'polkadot-fellows/dev-asset-hub-migratio…
bkontur May 13, 2025
d79e7cb
Governance integration tests for Kusama (#15)
karolk91 Jun 10, 2025
c041a1d
Merge branch 'dev-asset-hub-migration' into bko-ahm-governance-root
bkontur Jun 10, 2025
a7942f2
We dont need `note_preimage` with `dispatch_whitelisted_call_with_pre…
bkontur Jun 10, 2025
0aa31bf
Add TODOs
bkontur Jun 10, 2025
77e9014
Adding `CallIsNotWhitelisted` event check
bkontur Jun 10, 2025
a8796ec
Mistery solved
bkontur Jun 10, 2025
6298e0d
TODO
bkontur Jun 10, 2025
42c1e3d
Introduce assert_whitelisted impl and usage (#16)
karolk91 Jun 12, 2025
bcd9129
Merge remote-tracking branch 'polkadot-fellows/dev-asset-hub-migratio…
bkontur Jul 3, 2025
1e3bfc0
Fix/split `GovernanceLocation` for system paras (Polkadot).
bkontur Jul 3, 2025
a314683
GeneralAdmin/StakingAdmin/Fellows/Treasurer origin for OpenGov on AH …
bkontur Jul 3, 2025
c00b3fe
Merge remote-tracking branch 'polkadot-fellows/dev-asset-hub-migratio…
bkontur Jul 7, 2025
3f5c537
Clean-up after rebase
bkontur Jul 7, 2025
5987c5a
Merge remote-tracking branch 'upstream/dev-asset-hub-migration' into …
karolk91 Aug 21, 2025
1aa8c6d
AssetHub Polkadot runtime governance tests
karolk91 Jun 24, 2025
2c80abd
asset-hub-polkadot/tests/tests.rs formatting
karolk91 Jun 24, 2025
2cb0633
Kusama Asset Hub governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
12e461a
Polkadot Collectives governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
f4e9d1a
Kusama Bridge Hub governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
2950d15
Polkadot Bridge Hub governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
4ee61ad
Polkadot Coretime governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
fbaab37
Kusama Coretime governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
47a203a
Kusama People governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
6366df2
Polkadot People governance_authorize_upgrade_works tests
karolk91 Jun 24, 2025
39b5c83
coretime-kusama/src/tests.rs formatting
karolk91 Jun 24, 2025
d236941
Kusama Encointer governance_authorize_upgrade_works tests
karolk91 Jun 25, 2025
e0124b2
Move GovernanceLocation definition to common package
karolk91 Jun 25, 2025
cf0ba75
Add missing Encointer tests folder
karolk91 Jun 25, 2025
9991e77
Governance integration tests on Kusama (by karolk91) (for OpenGov on RC)
bkontur Jun 25, 2025
872eab8
Add Polkadot governance integration tests
karolk91 Jun 26, 2025
647bad4
Apply suggestions from code review
karolk91 Jun 26, 2025
d374458
Assert whitelisted event for Kusama tests
karolk91 Jun 26, 2025
b1ee05f
Use RelayChainLocation and AssetHubLocation instead of *GovernanceLoc…
karolk91 Aug 21, 2025
c06269d
Adapt governance tests to latest
karolk91 Aug 21, 2025
857196c
Deps cleanup
karolk91 Aug 21, 2025
3661bf1
Use polkadot-sdk utils for opengov tests
karolk91 Aug 21, 2025
dc92e6c
Add missing common.rs file
karolk91 Aug 21, 2025
3214c8e
Merge pull request #22 from karolk91/kk-bko-ahm-governance-root
bkontur Aug 21, 2025
c2f62cb
ParentAsSuperuser -> LocationAsSuperuser
karolk91 Aug 21, 2025
f6fa69a
Merge remote-tracking branch 'upstream/oty-dev-asset-hub-migration-25…
karolk91 Sep 4, 2025
effb536
Remove unused deps
karolk91 Sep 4, 2025
ee11d87
Apply suggestions from code review
bkontur Sep 4, 2025
9a6d5fa
Merge remote-tracking branch 'upstream/oty-dev-asset-hub-migration-25…
karolk91 Sep 4, 2025
8d8238f
system-parachains/common/Cargo.toml cleanup
karolk91 Sep 4, 2025
3fee5de
Allow respective VoiceOfBody for Staking/General Admin
karolk91 Sep 5, 2025
7f90e08
Removed TODO
bkontur Sep 5, 2025
b7adb63
Fix CollatorSelectionUpdateOrigin for AHP
bkontur Sep 5, 2025
c69b865
Allow `FellowshipAdmin` origin/track propagation from AHK to Kusama
bkontur Sep 5, 2025
e3ab235
More tests nits + Cargo.lock
bkontur Sep 5, 2025
403ce02
Removed TODO
bkontur Sep 5, 2025
2b95287
Add LocalPlurality to WaivedLocations for free sending xcm from refer…
bkontur Sep 5, 2025
adaa515
System paras accept AssetHubPlurality for UnpaidExecution
bkontur Sep 5, 2025
0f6e9c1
Allow unpaid execution for all system parachains for AssetHubPlurality
bkontur Sep 5, 2025
529f901
Add integration test for propagating unpaid plurality execution from …
bkontur Sep 5, 2025
123012b
Allow unpaid execution on relaychains for AssetHubPlurality
bkontur Sep 5, 2025
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.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ decl_test_parachains! {
PoolAssets: asset_hub_polkadot_runtime::PoolAssets,
AssetConversion: asset_hub_polkadot_runtime::AssetConversion,
SnowbridgeSystemFrontend: asset_hub_polkadot_runtime::SnowbridgeSystemFrontend,
Preimage: asset_hub_polkadot_runtime::Preimage,
}
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ decl_test_relay_chains! {
Balances: polkadot_runtime::Balances,
Treasury: polkadot_runtime::Treasury,
AssetRate: polkadot_runtime::AssetRate,
Preimage: polkadot_runtime::Preimage,
Hrmp: polkadot_runtime::Hrmp,
}
},
Expand Down
1 change: 0 additions & 1 deletion integration-tests/emulated/helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pallet-xcm = { workspace = true, default-features = true }
# Cumulus
xcm-emulator = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true, default-features = true }
asset-test-utils = { workspace = true }
emulated-integration-tests-common = { workspace = true }

[features]
Expand Down
1 change: 0 additions & 1 deletion integration-tests/emulated/helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub use pallet_xcm;
pub use xcm::prelude::{AccountId32, VersionedAssets, Weight, WeightLimit};

// Cumulus
pub use asset_test_utils;
pub use cumulus_pallet_xcmp_queue;
pub use emulated_integration_tests_common::{macros::Dmp, test_chain_can_claim_assets};
pub use xcm_emulator::Chain;
Expand Down
14 changes: 0 additions & 14 deletions integration-tests/emulated/tests/governance/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,3 @@ integration-tests-helpers = { workspace = true }
people-kusama-runtime = { workspace = true }
kusama-runtime = { workspace = true }
kusama-system-emulated-network = { workspace = true }

[features]
runtime-benchmarks = [
"asset-hub-kusama-runtime/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"integration-tests-helpers/runtime-benchmarks",
"kusama-runtime/runtime-benchmarks",
"kusama-system-emulated-network/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
"people-kusama-runtime/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
22 changes: 22 additions & 0 deletions integration-tests/emulated/tests/governance/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
mod imports {
pub(crate) use emulated_integration_tests_common::{
assert_whitelisted,
impls::{Parachain, RelayChain, TestExt},
xcm_emulator::Chain,
xcm_helpers::{
build_xcm_send_authorize_upgrade_call, call_hash_of,
dispatch_whitelisted_call_with_preimage,
},
};
pub(crate) use frame_support::{assert_err, assert_ok};
pub(crate) use kusama_runtime::{governance::pallet_custom_origins::Origin, Dmp};
pub(crate) use sp_runtime::{traits::Dispatchable, DispatchError};

pub(crate) use kusama_system_emulated_network::{
AssetHubKusamaPara as AssetHubKusama, BridgeHubKusamaPara as BridgeHubKusama,
CoretimeKusamaPara as CoretimeKusama, KusamaRelay as Kusama,
PeopleKusamaPara as PeopleKusama,
};
}

#[cfg(test)]
mod open_gov_on_relay;
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use emulated_integration_tests_common::{
assert_whitelisted,
impls::RelayChain,
xcm_emulator::{Chain, Parachain, TestExt},
xcm_helpers::{
build_xcm_send_authorize_upgrade_call, call_hash_of,
dispatch_whitelisted_call_with_preimage,
},
};
use frame_support::{assert_err, assert_ok};
use kusama_runtime::{governance::pallet_custom_origins::Origin, Dmp};
use kusama_system_emulated_network::{
AssetHubKusamaPara as AssetHubKusama, BridgeHubKusamaPara as BridgeHubKusama,
CoretimeKusamaPara as CoretimeKusama, KusamaRelay as Kusama, PeopleKusamaPara as PeopleKusama,
};
use sp_runtime::{traits::Dispatchable, DispatchError};
use crate::imports::*;

#[test]
fn relaychain_can_authorize_upgrade_for_itself() {
Expand Down
53 changes: 53 additions & 0 deletions integration-tests/emulated/tests/governance/polkadot/src/common.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md
// for a list of specific contributors.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::imports::*;

/// CollectivesPolkadot dispatches `pallet_xcm::send` with `OriginKind:Xcm` to the dest with encoded
/// whitelist call.
pub fn collectives_send_whitelist(
dest: Location,
encoded_whitelist_call: impl FnOnce() -> Vec<u8>,
) {
CollectivesPolkadot::execute_with(|| {
type RuntimeEvent = <CollectivesPolkadot as Chain>::RuntimeEvent;
type RuntimeCall = <CollectivesPolkadot as Chain>::RuntimeCall;
type RuntimeOrigin = <CollectivesPolkadot as Chain>::RuntimeOrigin;
type Runtime = <CollectivesPolkadot as Chain>::Runtime;

let whitelist_call = RuntimeCall::PolkadotXcm(pallet_xcm::Call::<Runtime>::send {
dest: bx!(VersionedLocation::from(dest)),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
fallback_max_weight: None,
call: encoded_whitelist_call().into(),
}
]))),
});

use collectives_polkadot_runtime::fellowship::pallet_fellowship_origins::Origin::Fellows as FellowsOrigin;
let fellows_origin: RuntimeOrigin = FellowsOrigin.into();
assert_ok!(whitelist_call.dispatch(fellows_origin));
assert_expected_events!(
CollectivesPolkadot,
vec![
RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {},
]
);
});
}
71 changes: 28 additions & 43 deletions integration-tests/emulated/tests/governance/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,35 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use emulated_integration_tests_common::{
impls::{assert_expected_events, bx, TestExt},
xcm_emulator::Chain,
};
use frame_support::assert_ok;
use polkadot_system_emulated_network::CollectivesPolkadotPara as CollectivesPolkadot;
use sp_runtime::traits::Dispatchable;
use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm};

#[cfg(test)]
mod open_gov_on_relay;
mod imports {
pub(crate) use codec::Encode;
pub(crate) use emulated_integration_tests_common::{
assert_whitelisted,
impls::{assert_expected_events, bx, Parachain, RelayChain, TestExt},
xcm_emulator::Chain,
xcm_helpers::{
build_xcm_send_authorize_upgrade_call, call_hash_of,
dispatch_whitelisted_call_with_preimage,
},
};
pub(crate) use frame_support::{assert_err, assert_ok};
pub(crate) use polkadot_runtime::{governance::pallet_custom_origins::Origin, Dmp};
pub(crate) use sp_runtime::{traits::Dispatchable, DispatchError};
pub(crate) use xcm::{latest::prelude::*, VersionedLocation, VersionedXcm};

/// CollectivesPolkadot dispatches `pallet_xcm::send` with `OriginKind:Xcm` to the dest with encoded
/// whitelist call.
pub fn collectives_send_whitelist(
dest: Location,
encoded_whitelist_call: impl FnOnce() -> Vec<u8>,
) {
CollectivesPolkadot::execute_with(|| {
type RuntimeEvent = <CollectivesPolkadot as Chain>::RuntimeEvent;
type RuntimeCall = <CollectivesPolkadot as Chain>::RuntimeCall;
type RuntimeOrigin = <CollectivesPolkadot as Chain>::RuntimeOrigin;
type Runtime = <CollectivesPolkadot as Chain>::Runtime;
pub(crate) use polkadot_system_emulated_network::{
AssetHubPolkadotPara as AssetHubPolkadot, BridgeHubPolkadotPara as BridgeHubPolkadot,
CollectivesPolkadotPara as CollectivesPolkadot, CoretimePolkadotPara as CoretimePolkadot,
PeoplePolkadotPara as PeoplePolkadot, PolkadotRelay as Polkadot,
};
}

let whitelist_call = RuntimeCall::PolkadotXcm(pallet_xcm::Call::<Runtime>::send {
dest: bx!(VersionedLocation::from(dest)),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
fallback_max_weight: None,
call: encoded_whitelist_call().into(),
}
]))),
});
#[cfg(test)]
mod common;

use collectives_polkadot_runtime::fellowship::pallet_fellowship_origins::Origin::Fellows as FellowsOrigin;
let fellows_origin: RuntimeOrigin = FellowsOrigin.into();
assert_ok!(whitelist_call.dispatch(fellows_origin));
assert_expected_events!(
CollectivesPolkadot,
vec![
RuntimeEvent::PolkadotXcm(pallet_xcm::Event::Sent { .. }) => {},
]
);
});
}
#[cfg(test)]
mod open_gov_on_asset_hub;

#[cfg(test)]
mod open_gov_on_relay;
Loading
Loading