mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
4e6f6d1e9c
* spike: incentive/types * spike: incentive/types tests * spike: incentive/types/expected_keepers.go * spike: incentive/keeper * spike: incentive/keeper tests * spike: incentive/sims and incentive/sims tests * spike: incentive/module * spike: incentive/module tests * spike: hard/types * spike: hard/types hooks * spike: hard/types * spike: hard/keeper basics * spike: hard/keeper hooks * integrate hard/keeper/borrow.go * integrate hard/keeper/deposit.go * integrate hard/keeper/liquidation.go * integrate hard/keeper/withdraw.go * integrate hard/keeper/repay.go * spike: hard/sims * spike: hard/sims tests * spike: hard/client * spike: hard/module * integrate app.go * spike: x/hard/keeper compile tests * incentive/keeper test clean up * validate usdx incentive types in genesis * refactoring & fix deposit test * fix liquidaton tests * fix incentive tests for hard supply rewards * fix hard genesis tests * update incentive genesis state and params * update cdp rewards accumulation * update app init order and begin blocker order Co-authored-by: karzak <kjydavis3@gmail.com>
31 lines
677 B
Go
31 lines
677 B
Go
package incentive
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/kava-labs/kava/x/incentive/keeper"
|
|
)
|
|
|
|
// BeginBlocker runs at the start of every block
|
|
func BeginBlocker(ctx sdk.Context, k keeper.Keeper) {
|
|
params := k.GetParams(ctx)
|
|
for _, rp := range params.USDXMintingRewardPeriods {
|
|
err := k.AccumulateUSDXMintingRewards(ctx, rp)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
for _, rp := range params.HardSupplyRewardPeriods {
|
|
err := k.AccumulateHardSupplyRewards(ctx, rp)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
for _, rp := range params.HardBorrowRewardPeriods {
|
|
err := k.AccumulateHardBorrowRewards(ctx, rp)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
}
|