Open
Conversation
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.
Summary
Add E2E tests for coldkey swap using polkadot-api (papi).
Changes
Moonwall config (
moonwall.config.json)zombienet_coldkey_swapenvironment with papi connectiongenerate-types.shtorunScriptsso papi descriptors are generated before test runUtility files
utils/coldkey_swap.ts— Helpers for coldkey swap operations:announceColdkeySwap,swapColdkeyAnnounced,disputeColdkeySwap,clearColdkeySwapAnnouncement,sudoResetColdkeySwap,sudoSwapColdkey, and storage query helpers. UsescoldkeyHashBinary()for papiFixedSizeBinary<32>hash params.utils/transactions.ts—sendTransactionwrapper that returns success/failure instead of throwing, for negative tests.Test files
00-coldkey-swap.test.ts— User-initiated coldkey swap tests:clear_coldkey_swap_announcement(happy path, too early, no announcement, after dispute)CheckColdkeySwapdispatch guard — active announcement blocksadd_stakeandBalances.transfer_keep_alive; swap-related calls (announce_coldkey_swap,dispute_coldkey_swap) still allowed throughCheckColdkeySwapdispatch guard — disputed swap blocks ALL calls includingadd_stake,Balances.transfer_keep_alive, and even swap-related calls (swap_coldkey_announced)01-coldkey-swap-sudo.test.ts— Sudo coldkey swap tests (reset, instant swap, clears pending announcement)