-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathabci.go
More file actions
24 lines (19 loc) · 809 Bytes
/
Copy pathabci.go
File metadata and controls
24 lines (19 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package keeper
import (
"context"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/x/staking/types"
"github.com/cosmos/cosmos-sdk/telemetry"
)
// BeginBlocker will persist the current header and validator set as a historical entry
// and prune the oldest entry based on the HistoricalEntries parameter
func (k *Keeper) BeginBlocker(ctx context.Context) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker)
return k.TrackHistoricalInfo(ctx)
}
// EndBlocker called at every block, update validator set
func (k *Keeper) EndBlocker(ctx context.Context) ([]appmodule.ValidatorUpdate, error) {
start := telemetry.Now()
defer telemetry.ModuleMeasureSince(types.ModuleName, start, telemetry.MetricKeyEndBlocker)
return k.BlockValidatorUpdates(ctx)
}