Commit Graph

2 Commits

Author SHA1 Message Date
Derrick Lee
cf009647e6
Use different accumulator for earn (#1395)
* Add accumulators

* Move accumulator back to keeper package

* Add earn specific accumulators

* Move store methods to sub-package

* Move earn accumulator

* Rename accumulator files

* Add store doc comment

* Add earn accumulator tests, panic if accumulator not used with earn claim type

* Update earn accumulator tests to use new methods

* Add staking test for earn accumulator

* Add test for accumulator proportional rewards

* Remove old copy of GetProportionalRewardsPerSecond

* Add test for basic accumulator

* Fix AddIncentiveMultiRewardPeriod replacement

* Deduplicate base earn reward accumulator

* Check errors in tests

* Validate RewardPeriods in Params.Validate()

* Use adapter to fetch earn total shares
2022-11-29 14:23:33 -08:00
Derrick Lee
73bc32a183
Add incentive earn tests with real keepers (#1354)
* Update incentive test to use beginblocker instead manual accumulation

* Update integration test suite

* Add base integration test, wip staking reward calculation

* Get actual staking reward amounts from BeginBlocker events, calculate expected indexes

* Simplify event parsing

* Add initial earn accum test with real keepers

* Add the rest of the accum integration tests with real keepers

* Check if delegation rewards are zero before transferring

* Update staking integration test to use updated methods
2022-10-19 16:13:37 -07:00