Improved readability of API for cumulative rewards

This commit is contained in:
Greg Hysen
2019-09-16 14:30:26 -07:00
parent 12f0797ace
commit f9163ccc01
7 changed files with 178 additions and 76 deletions

View File

@@ -34,11 +34,18 @@ blockchainTests.resets('Cumulative Reward Tracking', env => {
});
describe('Tracking Cumulative Rewards (CR)', () => {
it('should set CR and Most Recent CR when a pool is created', async () => {
it('should set CR hen a pool is created is epoch 0', async () => {
await simulation.runTestAsync(
[],
[TestAction.CreatePool],
[{ event: 'SetCumulativeReward', epoch: 0 }, { event: 'SetMostRecentCumulativeReward', epoch: 0 }],
[{ event: 'SetCumulativeReward', epoch: 0 }],
);
});
it('should set CR and Most Recent CR when a pool is created in epoch >0', async () => {
await simulation.runTestAsync(
[TestAction.Finalize],
[TestAction.CreatePool],
[{ event: 'SetCumulativeReward', epoch: 1 }, { event: 'SetMostRecentCumulativeReward', epoch: 1 }],
);
});
it('should not set CR or Most Recent CR when values already exist for the current epoch', async () => {