Conversation
The `apply_authorized_upgrade` call is sensitive to scheduled runtime upgrades; it's been removed.
When a real runtime upgrade is in progress at the fork block, upgrade tests fail because the chain state conflicts with the test's own upgrade flow. Add skipIfRealUpgradePending() helper that detects two conditions: 1. system.authorizedUpgrade is set (covers ALL chains including relay) 2. parachainSystem.pendingValidationCode is non-empty (parachain-specific) When detected, the test is skipped via ctx.skip() instead of failing. Wired into the two authorizeUpgradeWithoutChecks* wrapper functions only — the authorizeUpgrade (with-checks) variants are unaffected since they expect failure at SpecVersionNeedsToIncrease before reaching the pending code check.
- Add psmStableAssetId (4242/pUSD), psmUsdcId (1337), psmUsdtId (1984) - Inject PSM pallet storage via initStorages (Chopsticks dev.setStorage): MaxPsmDebtOfTotal=50%, ExternalAssets with AllEnabled for USDC+USDT, 0.5% fees, 60/40 ceiling weights - Pre-fund Alice/Bob with USDC and Alice with pUSD for swap tests
Also, fix previously failing tests; data about pUSD needed to exist in storage for some of the tests to pass; in other cases, incorrect swap amounts were being used.
The pallet had already been deployed WAH, so instead of relying on a manually wired runtime, this commit creates the necessary structure to instead run the PSM E2E tests on Westend.
Collaborator
Author
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #586.
The PSM pallet (polkadot-sdk#11068) is not deployed to any production chain. To run E2E tests against it, a custom PAH runtime was built with the pallet patched in and fed to Chopsticks via the
ASSETHUBPOLKADOT_WASMenvironment variable.EDIT: the PSM pallet has recently been deployed to WAH; the PR has been changed to use it instead. However, the below instructions are still valid to run PET tests against PAH/KAH (the
runtimesbranch contains all required changes for PAH; KAH is a matter of replication).The patched runtime lives in the
psm-e2e-runtimebranch of the runtimes repository. To reproduce the build:git clone -b psm-e2e-runtime git@github.com:rockbmb/runtimes.git cd runtimes cargo build -p asset-hub-polkadot-runtime --releaseThen run:
ASSETHUBPOLKADOT_WASM=target/release/wbuild/asset-hub-polkadot-runtime/asset_hub_polkadot_runtime.compact.compressed.wasm yarn test -t psmpsm-e2e-runtimebranch ontomainnow that polkadot-sdk#11068 has been merged; verify that the extra scaffolding added to the PAH runtime still compiles and is compatible with the latest runtimes releaseassetHubWestend.psm.e2e.test.ts, and test PSM on WAH