messages

package
v0.6.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2024 License: GPL-3.0, LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodecVersion = 0

	MaxMessageSize = 24 * units.KiB
)

Variables

Functions

This section is empty.

Types

type Payload

type Payload interface {
	// Bytes returns the binary representation of this payload.
	Bytes() []byte
	// contains filtered or unexported methods
}

Payload provides a common interface for all payloads implemented by this package.

func Parse

func Parse(bytes []byte) (Payload, error)

type Signable

type Signable interface {
	VerifyMesssage(sourceAddress []byte) error
}

Signable is an optional interface that payloads can implement to allow on-the-fly signing of incoming messages by the warp backend.

type ValidatorUptime

type ValidatorUptime struct {
	ValidationID ids.ID `serialize:"true"`
	TotalUptime  uint64 `serialize:"true"`
	// contains filtered or unexported fields
}

ValidatorUptime is signed when the ValidationID is known and the validator has been up for TotalUptime seconds.

func NewValidatorUptime

func NewValidatorUptime(validationID ids.ID, totalUptime uint64) (*ValidatorUptime, error)

NewValidatorUptime creates a new *ValidatorUptime and initializes it.

func ParseValidatorUptime

func ParseValidatorUptime(b []byte) (*ValidatorUptime, error)

ParseValidatorUptime converts a slice of bytes into an initialized ValidatorUptime.

func (*ValidatorUptime) Bytes

func (b *ValidatorUptime) Bytes() []byte

Bytes returns the binary representation of this payload. It assumes that the payload is initialized from either NewValidatorUptime or Parse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL