forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some fixes for zombienet tests (polkadot-staging) (paritytech#2704)
* renamed test file * wait until HRMP channel is opened
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
async function run(nodeName, networkInfo, args) { | ||
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName]; | ||
const api = await zombie.connect(wsUri, userDefinedTypes); | ||
|
||
const sibling = args[0]; | ||
|
||
while (true) { | ||
const messagingStateAsObj = await api.query.parachainSystem.relevantMessagingState(); | ||
const messagingState = api.createType("Option<CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot>", messagingStateAsObj); | ||
if (messagingState.isSome) { | ||
const egressChannels = messagingState.unwrap().egressChannels; | ||
if (egressChannels.find(x => x[0] == sibling)) { | ||
return; | ||
} | ||
} | ||
|
||
// else sleep and retry | ||
await new Promise((resolve) => setTimeout(resolve, 12000)); | ||
} | ||
} | ||
|
||
module.exports = { run } |
This file contains 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
This file contains 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