From 603147b1fffd2780def09fa22119217b4b650ba8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Apr 2023 09:45:05 +0000 Subject: [PATCH] fix: wait for proposal to pass --- --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -635,19 +635,20 @@ // <<< Fast track proposal through technical committee <<< const refIndexField = 0; - const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); + const referendumIndex = await this.helper.wait.eventData(3, 'democracy', 'Started', refIndexField); // >>> Referendum voting >>> console.log(`\t* Referendum #${referendumIndex} voting.......`); - await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex, { + await this.helper.democracy.referendumVote(dorothyAccount, referendumIndex!, { balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}, }); console.log(`\t* Referendum #${referendumIndex} voting.......DONE`); // <<< Referendum voting <<< - // Wait for the democracy execute - await this.helper.wait.newBlocks(5); + // Wait the proposal to pass + await this.helper.wait.event(3, 'democracy', 'Passed'); + await this.helper.wait.newBlocks(1); console.log(`[democracy] executing '${proposalDesciption}' proposal.......DONE`); } -- gitstuff