cbfttypes

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddValidatorEvent

type AddValidatorEvent struct {
	NodeID discover.NodeID
}

type BlockSignature

type BlockSignature struct {
	SignHash  common.Hash // Signature hash,header[0:32]
	Hash      common.Hash // Block hash,header[:]
	Number    *big.Int
	Signature *common.BlockConfirmSign
}

Block's Signature info

func (*BlockSignature) Copy

func (bs *BlockSignature) Copy() *BlockSignature

type CbftResult

type CbftResult struct {
	Block              *types.Block
	ExtraData          []byte
	SyncState          chan error
	ChainStateUpdateCB func()
}

type ProducerState

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

func (*ProducerState) Add

func (ps *ProducerState) Add(miner common.Address)

func (*ProducerState) Get

func (ps *ProducerState) Get() (common.Address, int)

func (*ProducerState) Validate

func (ps *ProducerState) Validate(period int) bool

type RemoveValidatorEvent

type RemoveValidatorEvent struct {
	NodeID discover.NodeID
}

type SortedValidatorNode

type SortedValidatorNode []*ValidateNode

func (SortedValidatorNode) Len

func (sv SortedValidatorNode) Len() int

func (SortedValidatorNode) Less

func (sv SortedValidatorNode) Less(i, j int) bool

func (SortedValidatorNode) Swap

func (sv SortedValidatorNode) Swap(i, j int)

type UpdateChainStateFn

type UpdateChainStateFn func(qcState, lockState, commitState *protocols.State)

type UpdateValidatorEvent

type UpdateValidatorEvent struct{}

type ValidateNode

type ValidateNode struct {
	Index     uint32           `json:"index"`
	Address   common.Address   `json:"address"`
	PubKey    *ecdsa.PublicKey `json:"-"`
	NodeID    discover.NodeID  `json:"nodeID"`
	BlsPubKey *bls.PublicKey   `json:"blsPubKey"`
}

func (*ValidateNode) String

func (vn *ValidateNode) String() string

func (*ValidateNode) Verify

func (vn *ValidateNode) Verify(data, sign []byte) error

type ValidateNodeMap

type ValidateNodeMap map[discover.NodeID]*ValidateNode

func (ValidateNodeMap) String

func (vnm ValidateNodeMap) String() string

type Validators

type Validators struct {
	Nodes            ValidateNodeMap `json:"validateNodes"`
	ValidBlockNumber uint64          `json:"validateBlockNumber"`
	// contains filtered or unexported fields
}

func (*Validators) Equal

func (vs *Validators) Equal(rsh *Validators) bool

func (*Validators) FindNodeByAddress

func (vs *Validators) FindNodeByAddress(addr common.Address) (*ValidateNode, error)

func (*Validators) FindNodeByID

func (vs *Validators) FindNodeByID(id discover.NodeID) (*ValidateNode, error)

func (*Validators) FindNodeByIndex

func (vs *Validators) FindNodeByIndex(index int) (*ValidateNode, error)

func (*Validators) Index

func (vs *Validators) Index(nodeID discover.NodeID) (uint32, error)

func (*Validators) Len

func (vs *Validators) Len() int

func (*Validators) NodeID

func (vs *Validators) NodeID(idx int) discover.NodeID

func (*Validators) NodeList

func (vs *Validators) NodeList() []discover.NodeID

func (*Validators) NodeListByBitArray

func (vs *Validators) NodeListByBitArray(vSet *utils.BitArray) ([]*ValidateNode, error)

func (*Validators) NodeListByIndexes

func (vs *Validators) NodeListByIndexes(indexes []uint32) ([]*ValidateNode, error)

func (*Validators) String

func (vs *Validators) String() string

Jump to

Keyboard shortcuts

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