prysm-pulse/beacon-chain/sync/subscriber_sync_committee_message.go
Nishant Das 97f6143a43
Add Remaining Gossip Changes (#9553)
* add changes

* add changes here in

* rem duplicate import

* fix topic not being set in test

* terence's review

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-10 02:36:31 +00:00

25 lines
552 B
Go

package sync
import (
"context"
"fmt"
"github.com/pkg/errors"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"google.golang.org/protobuf/proto"
)
// skipcq: SCC-U1000
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)
}