prysm-pulse/slasher/detection/attestations/iface/iface.go
Ivan Martinez b633dfe880
Change detection and updating in Slasher to per attestation (#5043)
* Change span updates to update multiple validators at once

* Change detection to perform on multiple validators at once

* Fix minspan issue

* Fix indices

* Fix test

* Remove logs

* Remove more logs

* Update slasher/detection/attestations/spanner_test.go

* Update slasher/detection/attestations/spanner_test.go

* Update slasher/detection/attestations/spanner_test.go

* Update slasher/detection/detect.go

* nil check

* fix ununsed import

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-03-09 13:14:19 -05:00

21 lines
516 B
Go

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.
DetectSlashingsForAttestation(
ctx context.Context,
att *ethpb.IndexedAttestation,
) ([]*types.DetectionResult, error)
// Write functions.
UpdateSpans(ctx context.Context, att *ethpb.IndexedAttestation) error
}