Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhe8x committed Jun 5, 2024
1 parent 88deba1 commit b27266c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/StakingAllocation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@ describe('StakingAllocation Contract', () => {
await checkAllocation(runner1, etherParse('9000'), etherParse('9000'), false, true);
});

it('add allocation to a stopped project', async () => {
await checkAllocation(runner0, etherParse('10000'), 0, false, false);
await stopService(projectRegistry, deploymentId0, runner0);

await expect(
stakingAllocation.connect(runner0).addAllocation(deploymentId0, runner0.address, etherParse('5000'))
).to.revertedWith('SAL05');

await startService(projectRegistry, deploymentId0, runner0);

await stakingAllocation.connect(runner0).addAllocation(deploymentId0, runner0.address, etherParse('5000'));
await checkAllocation(runner0, etherParse('10000'), etherParse('5000'), false, false);
});

it('over-allocate and recover', async () => {
await stakingAllocation
.connect(runner0)
Expand Down

0 comments on commit b27266c

Please sign in to comment.