prysm-pulse/beacon-chain/sync/subscriber_beacon_attestation.go
2019-12-16 19:53:55 -06:00

19 lines
526 B
Go

package sync
import (
"context"
"github.com/gogo/protobuf/proto"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
)
// beaconAttestationSubscriber forwards the incoming validated attestation to the blockchain
// service for processing.
func (r *Service) beaconAttestationSubscriber(ctx context.Context, msg proto.Message) error {
if err := r.operations.HandleAttestation(ctx, msg.(*ethpb.Attestation)); err != nil {
return err
}
return r.chain.ReceiveAttestationNoPubsub(ctx, msg.(*ethpb.Attestation))
}