mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
6fc1d41d44
Related to https://github.com/paritytech/polkadot-sdk/issues/3400 Moving all bridges testing "framework" files under one folder in order to be able to download the entire folder when we want to add tests in other repos No significant functional changes
23 lines
833 B
JavaScript
23 lines
833 B
JavaScript
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, 6000));
|
|
}
|
|
}
|
|
|
|
module.exports = { run }
|