diff --git a/contracts/staking/compiler.json b/contracts/staking/compiler.json index aa1f06e97c..f432301d36 100644 --- a/contracts/staking/compiler.json +++ b/contracts/staking/compiler.json @@ -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": { "*": { diff --git a/contracts/staking/test/unit_tests/finalizer_test.ts b/contracts/staking/test/unit_tests/finalizer_test.ts index fe7a78d372..f53f6d0a79 100644 --- a/contracts/staking/test/unit_tests/finalizer_test.ts +++ b/contracts/staking/test/unit_tests/finalizer_test.ts @@ -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