2019-09-09 21:13:50 +00:00
|
|
|
package testing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/gogo/protobuf/proto"
|
2019-11-27 05:08:18 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
2019-11-27 20:52:25 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/event"
|
2019-09-09 21:13:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Operations defines a mock for the operations service.
|
|
|
|
type Operations struct {
|
|
|
|
Attestations []*ethpb.Attestation
|
|
|
|
}
|
|
|
|
|
|
|
|
// AttestationPool --
|
|
|
|
func (op *Operations) AttestationPool(ctx context.Context, requestedSlot uint64) ([]*ethpb.Attestation, error) {
|
|
|
|
return op.Attestations, nil
|
|
|
|
}
|
|
|
|
|
2019-09-23 18:01:57 +00:00
|
|
|
// AttestationPoolNoVerify --
|
|
|
|
func (op *Operations) AttestationPoolNoVerify(ctx context.Context) ([]*ethpb.Attestation, error) {
|
|
|
|
return op.Attestations, nil
|
|
|
|
}
|
|
|
|
|
2019-11-18 17:19:03 +00:00
|
|
|
// AttestationPoolForForkchoice --
|
|
|
|
func (op *Operations) AttestationPoolForForkchoice(ctx context.Context) ([]*ethpb.Attestation, error) {
|
|
|
|
return op.Attestations, nil
|
|
|
|
}
|
|
|
|
|
2019-09-09 21:13:50 +00:00
|
|
|
// HandleAttestation --
|
|
|
|
func (op *Operations) HandleAttestation(context.Context, proto.Message) error {
|
|
|
|
return nil
|
|
|
|
}
|
2019-11-22 05:11:38 +00:00
|
|
|
|
|
|
|
// AttestationsBySlotCommittee --
|
|
|
|
func (op *Operations) AttestationsBySlotCommittee(ctx context.Context, slot uint64, index uint64) ([]*ethpb.Attestation, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
2019-11-27 20:52:25 +00:00
|
|
|
|
|
|
|
// IncomingProcessedBlockFeed --
|
|
|
|
func (op *Operations) IncomingProcessedBlockFeed() *event.Feed {
|
|
|
|
return new(event.Feed)
|
|
|
|
}
|
|
|
|
|
|
|
|
// IncomingAttFeed --
|
|
|
|
func (op *Operations) IncomingAttFeed() *event.Feed {
|
|
|
|
return nil
|
|
|
|
}
|