19 Commits

Author SHA1 Message Date
Greg Hysen
22e39f782f Some (more) readability improvements and minor optimizations to staking finalization. 2019-10-22 12:09:18 -07:00
Greg Hysen
d91a7fc663 Some readability improvements and minor optimizations to staking finalization. 2019-10-22 11:02:25 -07:00
Greg Hysen
ce8fd44234 Removed lingering references to stale terminology ("active pools") 2019-10-22 11:02:25 -07:00
Greg Hysen
6617ad9531 Refactored finalization state.
1. Removes state variables:
   - totalWeightedStakeThisEpoch
   - totalFeesCollectedThisEpoch
   - numActivePoolsThisEpoch

2. No longer indexes by epoch % 2

3. Renamed event StakingPoolActivated → StakingPoolEarnedRewards.

4. Renamed structs:
   - ActivePool → PoolStats. This holds stats for a pool that earned rewards.
   - UnfinalizedState → AggregatedStats. This aggregates stats from the former struct.
2019-10-22 11:02:25 -07:00
Amir Bandeali
1885957bd3 Update tests to start at epoch 1 2019-10-21 22:27:06 -07:00
Michael Zhu
dc06497cae consolidate MixinVaultCore and ZrxVault 2019-09-24 23:04:17 -07:00
Lawrence Forman
9dd8c61a2f @0x/contract-staking: Address review nits.
`@0x/contracts-utils`: Use `safeDiv()` in `LibFractions.normalize()`.
2019-09-23 11:55:02 -04:00
Lawrence Forman
c72a15b488 @0x/contracts-staking: All tests back up and running. 2019-09-22 12:20:42 -04:00
Lawrence Forman
6a29654d7d @0x/contracts-staking: Updating tests and making the contracts testable. 2019-09-22 12:20:04 -04:00
Lawrence Forman
14c4491b8c @0x/contracts-staking: Add some extra finalizer tests and light refactorings.
`@0x/contracts-staking`: Add finalization-related protocol fees unit tests.
2019-09-22 12:13:24 -04:00
Lawrence Forman
b43fa88606 @0x/contracts-staking: All tests but rewards_test working. 2019-09-22 12:13:24 -04:00
Lawrence Forman
d33080cf08 @0x/contracts-staking: Finalizer tests passing. 2019-09-22 12:11:47 -04:00
Lawrence Forman
a43b494302 @0x/contracts-staking: All tests passing! 2019-09-22 12:11:06 -04:00
Lawrence Forman
7ef3c12722 @0x/contracts-staking: Well, it almost worked. 2019-09-22 12:10:41 -04:00
Lawrence Forman
fa65452e2b @0x/contracts-staking: OK, two more finalizer tests. 2019-09-22 12:07:46 -04:00
Lawrence Forman
da0f6b5e8f @0x/contracts-test-utils: Finish off finalizer tests... for now. 2019-09-22 12:07:46 -04:00
Lawrence Forman
03c59fdaf7 @0x/contracts-staking: More MixinFinalizer unit tests. 2019-09-22 12:07:46 -04:00
Lawrence Forman
f5ab1e6f86 @0x/contracts-staking: Reduce code duplication in MixinFinalizer and add unit tests for it. 2019-09-22 12:07:46 -04:00
Lawrence Forman
a1aad2e55e @0x/contracts-exchange: Fixing tests and writing new ones. 2019-09-22 12:07:46 -04:00