Skip to content

Commit

Permalink
fix: fixed scenarios (#761)
Browse files Browse the repository at this point in the history
* fix: fixed scenarios

* fix: fixed scenarios

* chore: removed logs

* chore: lint

* fix: state
  • Loading branch information
adi44 authored Mar 23, 2022
1 parent c43731d commit 2ec3d73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion scenarios/scenarios.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const {
getState, adhocCommit, adhocReveal, getData, adhocPropose,
} = require('../test/helpers/utils');
const { mineBlock } = require('../test/helpers/testHelpers');
const {
COLLECTION_MODIFIER_ROLE,
GRACE_PERIOD,
Expand Down Expand Up @@ -77,7 +78,9 @@ describe('Scenarios', async () => {
}

while (Number(await getState()) !== 4) {
if (Number(await getState()) !== -1) {
if (Number(await getState()) === -1) {
await mineBlock();
} else {
await mineToNextState();
}
}
Expand Down
5 changes: 4 additions & 1 deletion test/AssignCollectionsRandomly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable prefer-destructuring */
const { expect } = require('chai');
const { network } = require('hardhat');
const { mineBlock } = require('./helpers/testHelpers');
const {
assertBNEqual,
mineToNextEpoch,
Expand Down Expand Up @@ -79,7 +80,9 @@ describe('AssignCollectionsRandomly', function () {
i++;
}
while (Number(await getState()) !== 4) {
if (Number(await getState()) !== -1) {
if (Number(await getState()) === -1) {
await mineBlock();
} else {
await mineToNextState();
}
}
Expand Down
1 change: 1 addition & 0 deletions test/helpers/testHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ module.exports = {
assertBNNotEqual,
waitNBlocks,
mineAdvance,
mineBlock,
mineToNextEpoch,
mineToNextState,
takeSnapshot,
Expand Down

0 comments on commit 2ec3d73

Please sign in to comment.