Authorize upgrade tests for testnet runtimes + `execute_as_governance` refactor (#7656)
Relates to: https://github.com/paritytech/polkadot-sdk/issues/7541
Relates to: https://github.com/paritytech/polkadot-sdk/issues/7566
This PR contains improved test cases that rely on the governance
location as preparation for AHM to capture the state as it is.
It introduces `execute_as_governance_call`, which can be configured with
various governance location setups instead of the hard-coded
`Location::parent()`.
Additionally, it adds a test for `authorize_upgrade` to all SP testnets.
## TODO
- [x] rewrite all tests using
`RuntimeHelper::<Runtime>::execute_as_governance` (because it is using
hard-coded `Location::parent()`) to use
`RuntimeHelper::<Runtime>::execute_as_governance_call`
## Follow-up
- [ ] add similar test for westend-runtime
- [ ] add test that ensure xcm-executor adds `ClearOrigin` before all
side-effect sent to different chain
---------
Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Showing
- cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs 1 addition, 1 deletion...lated/tests/assets/asset-hub-rococo/src/tests/treasury.rs
- cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs 11 additions, 7 deletions...arachains/runtimes/assets/asset-hub-rococo/tests/tests.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs 5 additions, 4 deletions...hains/runtimes/assets/asset-hub-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs 63 additions, 7 deletions...rachains/runtimes/assets/asset-hub-westend/tests/tests.rs
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs 41 additions, 12 deletions...ins/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/xcm_config.rs 1 addition, 0 deletions...runtimes/bridge-hubs/bridge-hub-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs 80 additions, 13 deletions...ns/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs
- cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs 22 additions, 16 deletions...ins/runtimes/bridge-hubs/test-utils/src/test_cases/mod.rs
- cumulus/parachains/runtimes/collectives/collectives-westend/src/xcm_config.rs 2 additions, 2 deletions...untimes/collectives/collectives-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/collectives/collectives-westend/tests/tests.rs 56 additions, 1 deletion...s/runtimes/collectives/collectives-westend/tests/tests.rs
- cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs 7 additions, 3 deletions...ains/runtimes/coretime/coretime-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/coretime/coretime-westend/tests/tests.rs 56 additions, 1 deletion...achains/runtimes/coretime/coretime-westend/tests/tests.rs
- cumulus/parachains/runtimes/people/people-westend/src/xcm_config.rs 7 additions, 3 deletions...rachains/runtimes/people/people-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/people/people-westend/tests/tests.rs 56 additions, 1 deletion.../parachains/runtimes/people/people-westend/tests/tests.rs
- cumulus/parachains/runtimes/test-utils/src/lib.rs 69 additions, 7 deletionscumulus/parachains/runtimes/test-utils/src/lib.rs
- cumulus/parachains/runtimes/test-utils/src/test_cases.rs 54 additions, 13 deletionscumulus/parachains/runtimes/test-utils/src/test_cases.rs
- prdoc/pr_7656.prdoc 25 additions, 0 deletionsprdoc/pr_7656.prdoc