Skip to content

Commit

Permalink
Updated votemanager test case according to minstake (#283)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
GauravJain9 authored Aug 5, 2021
1 parent dbd8bb2 commit 7b339f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/VoteManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7b339f6

Please sign in to comment.