forked from lesnikutsa/babylon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabci.go
31 lines (25 loc) · 1.03 KB
/
abci.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package incentive
import (
"context"
"time"
"github.com/babylonchain/babylon/x/incentive/keeper"
"github.com/babylonchain/babylon/x/incentive/types"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func BeginBlocker(ctx context.Context, k keeper.Keeper) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)
// handle coins in the fee collector account, including
// - send a portion of coins in the fee collector account to the incentive module account
// - accumulate BTC staking gauge at the current height
// - accumulate BTC timestamping gauge at the current epoch
if sdk.UnwrapSDKContext(ctx).HeaderInfo().Height > 0 {
k.HandleCoinsInFeeCollector(ctx)
}
return nil
}
func EndBlocker(ctx context.Context, k keeper.Keeper) ([]abci.ValidatorUpdate, error) {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)
return []abci.ValidatorUpdate{}, nil
}