ibfttypes

package
v22.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgPreprepare uint64 = iota
	MsgPrepare
	MsgCommit
	MsgRoundChange
)

Variables

This section is empty.

Functions

func Encode

func Encode(val interface{}) ([]byte, error)

Types

type Message

type Message struct {
	Code          uint64
	Msg           []byte
	Address       common.Address
	Signature     []byte
	CommittedSeal []byte
}

func (*Message) Decode

func (m *Message) Decode(val interface{}) error

func (*Message) DecodeRLP

func (m *Message) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Message) EncodeRLP

func (m *Message) EncodeRLP(w io.Writer) error

EncodeRLP serializes m into the Ethereum RLP format.

func (*Message) FromPayload

func (m *Message) FromPayload(b []byte, validateFn func([]byte, []byte) (common.Address, error)) error

func (*Message) Payload

func (m *Message) Payload() ([]byte, error)

func (*Message) PayloadNoSig

func (m *Message) PayloadNoSig() ([]byte, error)

func (*Message) String

func (m *Message) String() string

type State

type State uint64
const (
	StateAcceptRequest State = iota
	StatePreprepared
	StatePrepared
	StateCommitted
)

func (State) Cmp

func (s State) Cmp(y State) int

Cmp compares s and y and returns:

-1 if s is the previous state of y
 0 if s and y are the same state
+1 if s is the next state of y

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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