builders

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACommitMessage

func ACommitMessage(
	instanceId primitives.InstanceId,
	keyManager interfaces.KeyManager,
	senderMemberId primitives.MemberId,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	block interfaces.Block,
	randomSeed uint64) *interfaces.CommitMessage

func AMockBlockProof

func AMockBlockProof() *protocol.BlockProof

func ANewViewMessage

func ANewViewMessage(
	instanceId primitives.InstanceId,
	keyManager interfaces.KeyManager,
	senderMemberId primitives.MemberId,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	ppContentBuilder *protocol.PreprepareContentBuilder,
	confirmations []*protocol.ViewChangeMessageContentBuilder,
	block interfaces.Block) *interfaces.NewViewMessage

func APrepareMessage

func APrepareMessage(
	instanceId primitives.InstanceId,
	keyManager interfaces.KeyManager,
	senderMemberId primitives.MemberId,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	block interfaces.Block) *interfaces.PrepareMessage

func APreparedProofByMessages

func APreparedProofByMessages(PPMessage *interfaces.PreprepareMessage, PMessages []*interfaces.PrepareMessage) *protocol.PreparedProof

func APreprepareMessage

func APreprepareMessage(
	instanceId primitives.InstanceId,
	keyManager interfaces.KeyManager,
	senderMemberId primitives.MemberId,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	block interfaces.Block) *interfaces.PreprepareMessage

func ASimpleViewChangeVotes

func ASimpleViewChangeVotes(instanceId primitives.InstanceId, voters []*Voter, blockHeight primitives.BlockHeight, view primitives.View) []*protocol.ViewChangeMessageContentBuilder

func AViewChangeMessage

func AViewChangeMessage(
	instanceId primitives.InstanceId,
	keyManager interfaces.KeyManager,
	senderMemberId primitives.MemberId,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	preparedMessages *preparedmessages.PreparedMessages) *interfaces.ViewChangeMessage

func CreatePreparedMessages

func CreatePreparedMessages(
	instanceId primitives.InstanceId,
	leader Sender,
	members []Sender,
	blockHeight primitives.BlockHeight,
	view primitives.View,
	block interfaces.Block) *preparedmessages.PreparedMessages

func CreatePreparedProof

func CreatePreparedProof(
	instanceId primitives.InstanceId,
	ppSigner *MessageSigner,
	pSigners []*MessageSigner,
	height primitives.BlockHeight,
	view primitives.View,
	blockHash primitives.BlockHash) *protocol.PreparedProof

Types

type MessageSigner

type MessageSigner struct {
	KeyManager interfaces.KeyManager
	MemberId   primitives.MemberId
}

type NewViewBuilder

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

func NewNewViewBuilder

func NewNewViewBuilder() *NewViewBuilder

func (*NewViewBuilder) Build

func (builder *NewViewBuilder) Build() *interfaces.NewViewMessage

func (*NewViewBuilder) LeadBy

func (builder *NewViewBuilder) LeadBy(keyManager interfaces.KeyManager, memberId primitives.MemberId) *NewViewBuilder

func (*NewViewBuilder) OnBlock

func (builder *NewViewBuilder) OnBlock(block interfaces.Block) *NewViewBuilder

func (*NewViewBuilder) OnBlockHeight

func (builder *NewViewBuilder) OnBlockHeight(blockHeight primitives.BlockHeight) *NewViewBuilder

func (*NewViewBuilder) OnView

func (builder *NewViewBuilder) OnView(view primitives.View) *NewViewBuilder

func (*NewViewBuilder) WithCustomPreprepare

func (builder *NewViewBuilder) WithCustomPreprepare(instanceId primitives.InstanceId, keyManager interfaces.KeyManager, memberId primitives.MemberId, blockHeight primitives.BlockHeight, view primitives.View, block interfaces.Block) *NewViewBuilder

func (*NewViewBuilder) WithViewChangeVotes

func (builder *NewViewBuilder) WithViewChangeVotes(votes []*protocol.ViewChangeMessageContentBuilder) *NewViewBuilder

type Sender

type Sender interface {
	GetKeyManager() interfaces.KeyManager
	GetMemberId() primitives.MemberId
}

type Vote

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

type Voter

type Voter struct {
	KeyManager interfaces.KeyManager
	MemberId   primitives.MemberId
}

type VotesBuilder

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

func NewVotesBuilder

func NewVotesBuilder(instanceId primitives.InstanceId) *VotesBuilder

func (*VotesBuilder) Build

func (*VotesBuilder) WithVote

func (builder *VotesBuilder) WithVote(keyManager interfaces.KeyManager, memberId primitives.MemberId, blockHeight primitives.BlockHeight, view primitives.View, preparedMessages *preparedmessages.PreparedMessages) *VotesBuilder

Jump to

Keyboard shortcuts

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