* Add bkava handler for earn incentives
* Add bkava accum tests
* Add bkava denoms in index state
* Set storeTimeEquals to default value
* Add supply expected keepers
* Add tests for proportional adjustment
* Add liquid keeper to incentive keeper
* Use weighted reward periods for bkava
* Add liquid keeper to tests
* Add Accumulate override rewards period with deccoins
* Adjust test to handle sub unit coins
* Add liquid keeper to test
* Fix div by zero for proportional rewards
* Update test for actual expected values
* Update expected indexes to be same for different vaults
* Allow no stored time for vaults that have no indexes or state
* Add test for partial bkava deposit
* Add math check to test
* Deterministically iterate over bkava denoms
* Remove unused expected liquid method GetAllDerivativeDenoms
* Add incentive types
* Add earn state methods
* Update earn incentives
* Update unit test NewKeeper to include earn keeper
* Fix sharesOwned typo
* Shares not used for AfterVaultDepositCreated
* Add earn to init genesis
* Pass earn keeper to incentive keeper
* Add sdk.Msg impl, disable legacy migrations
* Disable migrations
* Update incentive earn sync test
* Add earn to client and querier
* Add accum and init tests
* Add additional earn tests
* Fill in fakeEarnKeeper methods to fix tests
* Add earn reward periods to params, begin blocker earn reward
* Add earn to query
* Update genesis_test with missing DefaultMultiRewardPeriods parameter
* Remove disable of migration package
* Fix proto type comments
* Remove unused migration state
* Add legacytx.LegacyMsg compile time interface check
* add earn state validation to genesis validation
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
* 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
* add get set methods for swap reward indexes
* add get set methods for swap accrual time
* tidy up location of multi periods
* add swap reward periods to params
* add initial legacy types for incentive
* minor refactor of migration code
* add incentive migration for swap params
* minor incentive test refactors
* add math methods to RewardIndexes
* add keeper method to increment global indexes
* add swap keeper to incentive keeper
* indicate if pool shares were found or not
* add accumulator to compute new rewards each block
* accumulate swap rewards globally
* remove unecessary keeper method
* expand doc comments on accumulator methods
* test precision not lost in accumulation
* minor fixes from merge
* rename storeGlobalDelegatorFactor to match others
* fix migration from merge
* fix bug in app setup
* fix accumulation bug when starting with no state
* rename swap files to match others
* add swap accumulation times to genesis
* remove old migration refactor
* minor updates to spec
* add high level description of how rewards work
* 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