Skip to content

Commit

Permalink
fix: fix tests to accomodate for new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanelly95 committed Jun 30, 2022
1 parent ebff97b commit 46fd833
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/Core/CollectionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ contract CollectionManager is Initializable, CollectionStorage, StateManager, Co
) external onlyRole(COLLECTION_MODIFIER_ROLE) notState(State.Commit, buffer) {
require(collectionID <= numCollections, "Collection ID not present");
require(tolerance <= maxTolerance, "Invalid tolerance value");
require(jobIDs.length > 0, "Job not present");
require(jobIDs.length > 0, "job not present");
uint32 epoch = _getEpoch();

uint256 jobsLength = jobIDs.length;
Expand Down
8 changes: 4 additions & 4 deletions test/CollectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('CollectionManager', function () {

it('should not be able to set Collection status if provided status is the same as current collectionstatus', async function () {
const tx1 = collectionManager.setCollectionStatus(false, 3);// status of collection with Id 3 is already false
await assertRevert(tx1, 'status not being changed');
await assertRevert(tx1, 'ID already inactive');
});

it('should not create collection if it does not have any jobIDs', async function () {
Expand All @@ -275,15 +275,15 @@ describe('CollectionManager', function () {
await assertRevert(tx, 'job not present');
});

it('updateCollection should only work for collections which are currently active', async function () {
it('updateCollection should not work if jobIDs array is empty', async function () {
await mineToNextEpoch(); // commit
await mineToNextState(); // reveal
await mineToNextState(); // propose
await mineToNextState(); // dispute
await mineToNextState(); // confirm
await blockManager.connect(signers[5]).claimBlockReward();
const tx = collectionManager.updateCollection(3, 500, 2, 5, [1]);
await assertRevert(tx, 'Collection is inactive');
const tx = collectionManager.updateCollection(3, 500, 2, 5, []);
await assertRevert(tx, 'job not present');
});

it('updateJob, updateCollection should not work in commit state', async function () {
Expand Down

0 comments on commit 46fd833

Please sign in to comment.