2019-08-23 15:46:04 -04:00
|
|
|
package sync
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/gogo/protobuf/proto"
|
2019-11-26 23:08:18 -06:00
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
2019-08-23 15:46:04 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// beaconAttestationSubscriber forwards the incoming validated attestation to the blockchain
|
|
|
|
// service for processing.
|
|
|
|
func (r *RegularSync) beaconAttestationSubscriber(ctx context.Context, msg proto.Message) error {
|
2019-08-27 20:19:47 -07:00
|
|
|
if err := r.operations.HandleAttestation(ctx, msg.(*ethpb.Attestation)); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-08-23 15:46:04 -04:00
|
|
|
return r.chain.ReceiveAttestationNoPubsub(ctx, msg.(*ethpb.Attestation))
|
|
|
|
}
|