mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 20:07:17 +00:00
279cc16c88
* add in digest * add new stuff * add tests * terence's review * Update beacon-chain/sync/subscriber.go Co-authored-by: terence tsao <terence@prysmaticlabs.com> * terence's review Co-authored-by: terence tsao <terence@prysmaticlabs.com>
24 lines
531 B
Go
24 lines
531 B
Go
package sync
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/pkg/errors"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (s *Service) syncCommitteeMessageSubscriber(_ context.Context, msg proto.Message) error {
|
|
m, ok := msg.(*ethpb.SyncCommitteeMessage)
|
|
if !ok {
|
|
return fmt.Errorf("message was not type *eth.SyncCommitteeMessage, type=%T", msg)
|
|
}
|
|
|
|
if m == nil {
|
|
return errors.New("nil sync committee message")
|
|
}
|
|
|
|
return s.cfg.SyncCommsPool.SaveSyncCommitteeMessage(m)
|
|
}
|