* Add consolidate methods
* Update distr feepool balance with dust, add tests
* Set params for proposal handler to not influence module balances
* Add StakingRewardsPerSecond param for proposal test
* Update changelog
* Update test to check emitted events
* Log dust amounts for x/distribution
* Modify feepool communitypool field instead of entire replacement
* Update tests to include cases with empty balances
* Move EventsContains to app
* Remove extra copied ModuleName
* Add Require() to incentive claims in tests to reduce errors
* Move consolidate tests to testutil
* Only transfer non-ukava coins
* Add DefaultStakingRewardsState to proposal handler test
* Move event emit before consolidate
* add golangci specific timeout
---------
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
* 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
* move multipliers to their own file
* add multipliers per denom to MsgClaimHardReward
* claim with multipliers per denom for hard claims
* remove unused error
* add multipliers per denom to params
connect to to hard claiming
* temporary fix migration
* update usdx claiming for new multiplier params
* claim with multipliers per denom for delegator
* claim with multipliers per denom for swap rewards
* tidy up multiplier name validation
* rename new multipliers field in params
* remove old multpliers from params
* clear up various TODOs
* add tags to new structs
* remove dead code
* extract borrow sync logic into separate func
* fix borrow reward calculations
Use the normalized borrow as the source shares in reward calculations.
* extract supply sync logic into separate func
* prepare to fix supply reward calculations
* fix deposit reward calculations
Use the normalized deposit as the source shares in reward calculations.
* extract usdx sync logic into separate func
* prepare to fix usdx reward calculations
* fix cdp reward calculations
Use the normalized cdp debt as the source shares in reward calculations.
* fix compile error from messed up partial stage
* Fix incentive usdx reward bug (#976)
* minor test refactors
* fix overpayment bug
Init methods should not read params.
Add test to cover bug
* fix typos
* add test for validate multi reward periods
* tidy up: combine files
* don't accumulate global indexes containing zeros
Previously if the time since last block was 0,
indexes were added containing 0s.
Now leave them out. Missing is assumed to be 0.
* move state independent test to types folder
* clarify reward source concept to "source shares"
- rename variables and update doc comments
- extract method from swap accumulation
* tidy up and expand swap accumulation unit tests
* rename swap test file to match others
* update swap pool id format in tests
* refactor borrow accumulation, use new accumulator
* refactor supply accumulation, use new accumulator
* refactor delegator accumulation, use accumulator
* refactor usdx accumulation, use new accumulator
* fix types const
* remove unsed methods
* more usdx minting param validation.
Protect against the rewards per second denom changing.
It should always be "ukava".
* add safety check in InitGenesis
It prevents huge accumulations on the first block by limiting all
previous accumulation times to be within one year of genesis
* add todo for adding swp token distirbution info
* organise testing committee gen state
* remove repeated test app initialization
* minor fixes from linter in tests
* move more setup to SetupApp
* split up KeeperTestSuite for each reward type
* simplify KeeperTestSuite
* simplify PayoutKeeperSuite
* simplify DelegatorRewardSuite
* simplify SupplyRewardsSuite
* simplify BorrowRewardsSuite
* simplify USDXRewardsSuite
* add auth genesis builder for easier test setup
* migrate all incentive tests to auth builder
* add incentive genesis builder for easier setup
migrate hard incentive tests
* migrate all tests to incentive builder
* add hard genesis builder
* small tidy ups
* deduplicate initialTime from borrow tests
* deduplicate initialtTime from supply tests
* deduplicate initialTime from usdx and keeper tests
* deduplicate initialTime in delgator tests
* deduplicate genesis time in payout test
* deduplicate test app initialization
* make authGenesisBuilder available for all modules
* remove unused pricefeed setup
* export incentive genesis builder
* remove commented out test cases
* migrate cdp test to new test state builders
* migrate vv payout tests to use new builders
* add SynchronizeHardBorrowReward unit test
* extract calculatReward method
* tidy up unit test for borrow rewards
* add helper method to RewardIndexes
* user helper to extract logic from SyncBorrowReward
* add Get methods to (Multi)RewardIndexes
* replace params.Subspace in keeper to test easier
* add unit tests for usdx minting
* refactor InitializeUSDXMintingClaim
* add unit tests for InitializeHardBorrowRewards
* refactor SynchronizeUSDXMintingReward
* add unit tests for UpdateHardBorrowIndexDenoms
* change rewardSource type to Dec
needed by delegation rewards
* fix typo in test names
* refactor UpdateHardBorrowIndexDenoms
* update genesis test TODO to use auth builder
* add skipped test for bug in usdx sync
* extract common method for calculating rewards
* doc comment tidy
* add unit tests for delegator rewards
* tidy up test files
* remove old TODOs
* reaarrange InitializeHardDelegatorReward
to fit with other init reward functions
* duplicate borrow unit tests to create supply tests
* add tests for syncing with zero rewards per second
* refactor SynchronizeHardDelegatorRewards
* refactor supply rewards in same way as borrow
* fix total delegation calculation bug
* fix new usdx reward bug
* fix new supply/borrow reward bug
* remove working comment
* standardize behaviour when global factors missing
* improve documentation for CalculateRewards
* standardize variable names
* remove panic from calculateSingleReward
* wip
* Tidy up comments
* remove wip comment
* organise testing committee gen state
* remove repeated test app initialization
* minor fixes from linter in tests
* move more setup to SetupApp
* split up KeeperTestSuite for each reward type
* simplify KeeperTestSuite
* simplify PayoutKeeperSuite
* simplify DelegatorRewardSuite
* simplify SupplyRewardsSuite
* simplify BorrowRewardsSuite
* simplify USDXRewardsSuite
* add auth genesis builder for easier test setup
* migrate all incentive tests to auth builder
* add incentive genesis builder for easier setup
migrate hard incentive tests
* migrate all tests to incentive builder
* add hard genesis builder
* small tidy ups
* deduplicate initialTime from borrow tests
* deduplicate initialtTime from supply tests
* deduplicate initialTime from usdx and keeper tests
* deduplicate initialTime in delgator tests
* deduplicate genesis time in payout test
* deduplicate test app initialization
* make authGenesisBuilder available for all modules
* remove unused pricefeed setup
* export incentive genesis builder
* remove commented out test cases
* migrate cdp test to new test state builders
* migrate vv payout tests to use new builders
* group reward code by type
* split out usdx reward tests into own file
* split out delegator reward tests into own file
* split supply borrow reward tests into own files
* sync order of test functions in files