@0x/contracts-staking: OK, two more finalizer tests.

This commit is contained in:
Lawrence Forman
2019-09-14 19:46:37 -04:00
committed by Lawrence Forman
parent da0f6b5e8f
commit fa65452e2b
2 changed files with 23 additions and 6 deletions

View File

@@ -8,12 +8,7 @@
"optimizer": {
"enabled": true,
"runs": 1000000,
"details": {
"yul": true,
"deduplicate": true,
"cse": true,
"constantOptimizer": true
}
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
},
"outputSelection": {
"*": {

View File

@@ -756,6 +756,28 @@ blockchainTests.resets('finalizer tests', env => {
membersStake: pool.membersStake,
});
});
it('gives all rewards to operator if membersStake is zero', async () => {
const pool = await addActivePoolAsync({ membersStake: 0 });
await testContract.endEpoch.awaitTransactionSuccessAsync();
const actualRewards = await testContract.internalGetUnfinalizedPoolRewards.callAsync(pool.poolId);
assertPoolRewards(actualRewards, {
operatorReward: INITIAL_BALANCE,
membersReward: 0,
membersStake: pool.membersStake,
});
});
it('gives all rewards to operator if membersStake is zero, even if operatorShare is zero', async () => {
const pool = await addActivePoolAsync({ membersStake: 0, operatorShare: 0 });
await testContract.endEpoch.awaitTransactionSuccessAsync();
const actualRewards = await testContract.internalGetUnfinalizedPoolRewards.callAsync(pool.poolId);
assertPoolRewards(actualRewards, {
operatorReward: INITIAL_BALANCE,
membersReward: 0,
membersStake: pool.membersStake,
});
});
});
});
// tslint:disable: max-file-line-count