mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-14 03:55:19 +00:00
4b8e224f6a
* Revert "Add incentive migrations for earn rewards (#1406)" This reverts commit937e5f339f
. * Revert "Use different accumulator for earn (#1395)" This reverts commitcf009647e6
. * Revert "Add base earn incentive accumulator (#1393)" This reverts commit44a90a8ef9
. * Revert "Add generic incentive `AccumulateRewards` method (#1392)" This reverts commitdce631d3de
. * Revert "Add GetSynchronizedClaim and swap adapter (#1386)" This reverts commitf52a581ea9
. * Revert "Add Initialize/Synchronize Claim methods (#1383)" This reverts commitc2061f626e
. * Revert "Add source adapter interface definition (#1377)" This reverts commit2abb2ce606
. * Revert "Add incentive RewardIndexes types and state methods (#1381)" This reverts commit4a3002b09c
. * Revert "Add AccrualTime type and state methods (#1379)" This reverts commitdf1c2ffc34
. * Revert "Add incentive claim state methods (#1375)" This reverts commit90735e29ed
. * Revert "Add generic Claim type (#1371)" This reverts commit45fc1a7643
. * Regerate protos and minor revert fixes
39 lines
1009 B
Go
39 lines
1009 B
Go
package incentive
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
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 {
|
|
k.AccumulateUSDXMintingRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.HardSupplyRewardPeriods {
|
|
k.AccumulateHardSupplyRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.HardBorrowRewardPeriods {
|
|
k.AccumulateHardBorrowRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.DelegatorRewardPeriods {
|
|
k.AccumulateDelegatorRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.SwapRewardPeriods {
|
|
k.AccumulateSwapRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.SavingsRewardPeriods {
|
|
k.AccumulateSavingsRewards(ctx, rp)
|
|
}
|
|
for _, rp := range params.EarnRewardPeriods {
|
|
if err := k.AccumulateEarnRewards(ctx, rp); err != nil {
|
|
panic(fmt.Sprintf("failed to accumulate earn rewards: %s", err))
|
|
}
|
|
}
|
|
}
|