prysm-pulse/slasher/detection/attestations/iface/iface.go
2021-07-21 21:34:07 +00:00

22 lines
600 B
Go

// Package iface defines an interface for a slashable attestation detector struct.
package iface
import (
"context"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/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.
DetectSlashingsForAttestation(
ctx context.Context,
att *ethpb.IndexedAttestation,
) ([]*types.DetectionResult, error)
// Write functions.
UpdateSpans(ctx context.Context, att *ethpb.IndexedAttestation) error
}