Documentation ¶
Index ¶
- type Consumer
- func (c *Consumer) OnInvalidMsgError(violation *Violation)
- func (c *Consumer) OnSenderEjectedError(violation *Violation)
- func (c *Consumer) OnUnAuthorizedSenderError(violation *Violation)
- func (c *Consumer) OnUnauthorizedUnicastOnChannel(violation *Violation)
- func (c *Consumer) OnUnexpectedError(violation *Violation)
- func (c *Consumer) OnUnknownMsgTypeError(violation *Violation)
- type Violation
- type ViolationsConsumer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is a struct that logs a message for any slashable offenses. This struct will be updated in the future when slashing is implemented.
func NewSlashingViolationsConsumer ¶
func NewSlashingViolationsConsumer(log zerolog.Logger, metrics module.NetworkSecurityMetrics) *Consumer
NewSlashingViolationsConsumer returns a new Consumer.
func (*Consumer) OnInvalidMsgError ¶
OnInvalidMsgError logs an error for messages that contained payloads that could not be unmarshalled into the message type denoted by message code byte.
func (*Consumer) OnSenderEjectedError ¶
OnSenderEjectedError logs an error for sender ejected error.
func (*Consumer) OnUnAuthorizedSenderError ¶
OnUnAuthorizedSenderError logs an error for unauthorized sender error.
func (*Consumer) OnUnauthorizedUnicastOnChannel ¶
OnUnauthorizedUnicastOnChannel logs an error for messages unauthorized to be sent via unicast.
func (*Consumer) OnUnexpectedError ¶
OnUnexpectedError logs an error for unexpected errors. This indicates message validation has failed for an unknown reason and could potentially be n slashable offense.
func (*Consumer) OnUnknownMsgTypeError ¶
OnUnknownMsgTypeError logs an error for unknown message type error.
type ViolationsConsumer ¶
type ViolationsConsumer interface { // OnUnAuthorizedSenderError logs an error for unauthorized sender error OnUnAuthorizedSenderError(violation *Violation) // OnUnknownMsgTypeError logs an error for unknown message type error OnUnknownMsgTypeError(violation *Violation) // OnInvalidMsgError logs an error for messages that contained payloads that could not // be unmarshalled into the message type denoted by message code byte. OnInvalidMsgError(violation *Violation) // OnSenderEjectedError logs an error for sender ejected error OnSenderEjectedError(violation *Violation) OnUnauthorizedUnicastOnChannel(violation *Violation) // OnUnexpectedError logs an error for unknown errors OnUnexpectedError(violation *Violation) }