github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/validator/validator.go (about)

     1  package validator
     2  
     3  import (
     4  	"github.com/libp2p/go-libp2p/core/peer"
     5  
     6  	"github.com/onflow/flow-go/network/message"
     7  	"github.com/onflow/flow-go/network/p2p"
     8  )
     9  
    10  // PubSubMessageValidator validates the given message with original sender `from` and returns p2p.ValidationResult.
    11  // Note: contrarily to pubsub.ValidatorEx, the peerID parameter does not represent the bearer of the message, but its source.
    12  type PubSubMessageValidator func(from peer.ID, msg *message.Message) p2p.ValidationResult