header

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalSignableVote

func MarshalSignableVote(r *bytes.Buffer, vote *Header) error

MarshalSignableVote marshals the fields necessary for a Committee member to cast a Vote (namely the Round, the Step and the BlockHash).

func UnmarshalSignableVote

func UnmarshalSignableVote(r *bytes.Buffer, vote *Header) error

UnmarshalSignableVote unmarshals the fields necessary for a Committee member to cast a Vote (namely the Round, the Step and the BlockHash).

Types

type Header struct {
	PubKeyBLS []byte
	Round     uint64
	Step      uint8
	BlockHash []byte
}

Header is an embeddable struct representing the consensus event header fields

func (*Header) Equal

func (h *Header) Equal(e wire.Event) bool

Equal implements wire.Event. Checks if two headers are the same.

func (*Header) Sender

func (h *Header) Sender() []byte

Sender implements wire.Event. Returns the BLS public key of the event sender.

type UnMarshaller

type UnMarshaller struct {
	// contains filtered or unexported fields
}

UnMarshaller marshals and unmarshals consensus event headers. It is a helper to be embedded in the various consensus message unmarshallers.

func NewUnMarshaller

func NewUnMarshaller() *UnMarshaller

NewUnMarshaller instantiates a struct to Marshal and Unmarshal event Headers

func (UnMarshaller) Marshal

func (hm UnMarshaller) Marshal(r *bytes.Buffer, ev wire.Event) error

Marshal a Header into a Buffer.

func (UnMarshaller) Unmarshal

func (hu UnMarshaller) Unmarshal(r *bytes.Buffer, ev wire.Event) error

Unmarshal unmarshals the buffer into a Header.

Jump to

Keyboard shortcuts

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