From 7b339f67821c3597e43c6eddadaa1a8b6bdcf8b3 Mon Sep 17 00:00:00 2001 From: Gaurav Jain <65170724+GauravJain9@users.noreply.github.com> Date: Thu, 5 Aug 2021 15:52:57 +0530 Subject: [PATCH] Updated votemanager test case according to minstake (#283) * Added test cases to increase coverage on VoteManager and rebased from master:razornetwork * Removed await keyword for assertRevert which is no longer required * Added test case for increasing coverage on vote manager * updated votemanager test case according to minstake which was changed after radao implementation * changed the stake according to minstake --- test/VoteManager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/VoteManager.js b/test/VoteManager.js index a71101b4..2890263f 100644 --- a/test/VoteManager.js +++ b/test/VoteManager.js @@ -73,12 +73,12 @@ describe('VoteManager', function () { await razor.transfer(signers[4].address, tokenAmount('19000')); await razor.transfer(signers[5].address, tokenAmount('1000')); await razor.transfer(signers[6].address, tokenAmount('1000')); - await razor.transfer(signers[7].address, tokenAmount('1000')); + await razor.transfer(signers[7].address, tokenAmount('2000')); await razor.connect(signers[3]).approve(stakeManager.address, tokenAmount('420000')); await razor.connect(signers[4]).approve(stakeManager.address, tokenAmount('19000')); await razor.connect(signers[5]).approve(stakeManager.address, tokenAmount('1000')); await razor.connect(signers[6]).approve(stakeManager.address, tokenAmount('1000')); - await razor.connect(signers[7]).approve(stakeManager.address, tokenAmount('1000')); + await razor.connect(signers[7]).approve(stakeManager.address, tokenAmount('2000')); const epoch = await getEpoch(); await stakeManager.connect(signers[3]).stake(epoch, tokenAmount('420000')); await stakeManager.connect(signers[4]).stake(epoch, tokenAmount('19000')); @@ -389,7 +389,7 @@ describe('VoteManager', function () { it('should not be able to commit if stake is below minstake', async function () { await mineToNextEpoch(); const epoch = await getEpoch(); - await stakeManager.connect(signers[7]).stake(epoch, tokenAmount('150')); + await stakeManager.connect(signers[7]).stake(epoch, tokenAmount('1000')); const stakerId = await stakeManager.stakerIds(signers[7].address); // slashing the staker to make his stake below minstake await stakeManager.grantRole(await parameters.getStakeModifierHash(), signers[0].address); @@ -445,7 +445,7 @@ describe('VoteManager', function () { it('Staker should not be able to reveal other than in reveal state', async function () { await mineToNextEpoch(); const epoch = await getEpoch(); - await stakeManager.connect(signers[7]).stake(epoch, tokenAmount('325')); + await stakeManager.connect(signers[7]).stake(epoch, tokenAmount('1000')); const votes = [100, 200, 300, 400, 500, 600, 700, 800, 900]; const tree = merkle('keccak256').sync(votes); const root = tree.root();