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.
Add withdraw reserve assets to zombienet tests (paritytech#2711)
* add withdraw-reserve-assets to zombienet tests * fix comments * added more comments
- Loading branch information
Showing
3 changed files
with
45 additions
and
9 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,20 @@ | ||
async function run(nodeName, networkInfo, args) { | ||
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName]; | ||
const api = await zombie.connect(wsUri, userDefinedTypes); | ||
|
||
const accountAddress = args[0]; | ||
const initialAccountData = await api.query.system.account(accountAddress); | ||
const initialAccountBalance = initialAccountData.data['free']; | ||
while (true) { | ||
const accountData = await api.query.system.account(accountAddress); | ||
const accountBalance = accountData.data['free']; | ||
if (accountBalance > initialAccountBalance) { | ||
return accountBalance; | ||
} | ||
|
||
// 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