Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanProgrammer committed Jan 10, 2024
1 parent ff6af67 commit a881778
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/mock/tokens/StETHMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract StETHMock is ERC20, Ownable {
constructor() ERC20("Staked Ether Mock", "stETHMock") {}

function mint(address account_, uint256 amount_) external {
require(amount_ <= 10 * (10 ** decimals()), "StETHMock: amount is too big");
require(amount_ <= 1000 * (10 ** decimals()), "StETHMock: amount is too big");

_mint(account_, amount_);
}
Expand Down
14 changes: 7 additions & 7 deletions test/Distribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ describe('Distribution', () => {
expect(await depositToken.balanceOf(distribution)).to.eq(wei(20));

await setNextTime(oneDay + oneDay);
await depositToken.setTotalPooledEther(wei(0.8, 25));
await depositToken.setBalanceMultiplicator(wei(0.8, 25));
expect(await depositToken.balanceOf(distribution)).to.eq(wei(16));

let tx = await distribution.withdraw(poolId, wei(999));
Expand All @@ -1330,7 +1330,7 @@ describe('Distribution', () => {
it('should revert if trying to withdraw zero', async () => {
await distribution.stake(poolId, wei(10));

await depositToken.setTotalPooledEther(wei(0.0001, 25));
await depositToken.setBalanceMultiplicator(wei(0.0001, 25));

await distribution.withdraw(poolId, wei(10));

Expand Down Expand Up @@ -1582,15 +1582,15 @@ describe('Distribution', () => {

await setTime(oneDay * 9999);

await depositToken.setTotalPooledEther(wei(0.5));
await depositToken.setBalanceMultiplicator(wei(0.5));

const overplus = await distribution.overplus();
expect(overplus).to.eq(0);
});
it('should return overplus if deposited token increased', async () => {
await distribution.stake(0, wei(1));

await depositToken.setTotalPooledEther(wei(2, 25));
await depositToken.setBalanceMultiplicator(wei(2, 25));

let overplus = await distribution.overplus();
expect(overplus).to.eq(wei(1));
Expand All @@ -1600,12 +1600,12 @@ describe('Distribution', () => {
overplus = await distribution.overplus();
expect(overplus).to.eq(wei(1));

await depositToken.setTotalPooledEther(wei(1, 25));
await depositToken.setBalanceMultiplicator(wei(1, 25));

overplus = await distribution.overplus();
expect(overplus).to.eq(0);

await depositToken.setTotalPooledEther(wei(5, 25));
await depositToken.setBalanceMultiplicator(wei(5, 25));

overplus = await distribution.overplus();
expect(overplus).to.eq(wei(5.5));
Expand All @@ -1626,7 +1626,7 @@ describe('Distribution', () => {

await distribution.stake(1, wei(1));

await depositToken.setTotalPooledEther(wei(2, 25));
await depositToken.setBalanceMultiplicator(wei(2, 25));

const overplus = await distribution.overplus();
expect(overplus).to.eq(wei(1));
Expand Down

0 comments on commit a881778

Please sign in to comment.