mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 21:27:19 +00:00
dccf0992e5
* add majority vote to e2e * extract policies to a separate package Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
28 lines
721 B
Go
28 lines
721 B
Go
package policies
|
|
|
|
// AfterNthEpoch runs for every epoch after the provided epoch.
|
|
func AfterNthEpoch(afterEpoch uint64) func(uint64) bool {
|
|
return func(currentEpoch uint64) bool {
|
|
return currentEpoch > afterEpoch
|
|
}
|
|
}
|
|
|
|
// AllEpochs runs for all epochs.
|
|
func AllEpochs(_ uint64) bool {
|
|
return true
|
|
}
|
|
|
|
// OnEpoch runs only for the provided epoch.
|
|
func OnEpoch(epoch uint64) func(uint64) bool {
|
|
return func(currentEpoch uint64) bool {
|
|
return currentEpoch == epoch
|
|
}
|
|
}
|
|
|
|
// BetweenEpochs runs for every epoch that is between the provided epochs.
|
|
func BetweenEpochs(fromEpoch, toEpoch uint64) func(uint64) bool {
|
|
return func(currentEpoch uint64) bool {
|
|
return fromEpoch < currentEpoch && currentEpoch < toEpoch
|
|
}
|
|
}
|