2020-02-27 04:48:02 +00:00
|
|
|
package iface
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
|
|
"github.com/prysmaticlabs/prysm/slasher/detection/attestations/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// SpanDetector defines an interface for Spanners to follow to allow mocks.
|
|
|
|
type SpanDetector interface {
|
|
|
|
// Read functions.
|
|
|
|
DetectSlashingForValidator(
|
|
|
|
ctx context.Context,
|
|
|
|
validatorIdx uint64,
|
|
|
|
attData *ethpb.AttestationData,
|
|
|
|
) (*types.DetectionResult, error)
|
2020-03-03 09:58:24 +00:00
|
|
|
SpanForEpochByValidator(ctx context.Context, valIdx uint64, epoch uint64) (types.Span, error)
|
|
|
|
ValidatorSpansByEpoch(ctx context.Context, epoch uint64) map[uint64]types.Span
|
2020-02-27 04:48:02 +00:00
|
|
|
|
|
|
|
// Write functions.
|
|
|
|
UpdateSpans(ctx context.Context, att *ethpb.IndexedAttestation) error
|
|
|
|
DeleteValidatorSpansByEpoch(ctx context.Context, validatorIdx uint64, epoch uint64) error
|
|
|
|
}
|