Documentation ¶
Index ¶
- Constants
- type BasicCheckError
- type CPValue
- type InvalidSignerError
- type Just
- type JustDecided
- type JustInitOne
- type JustInitZero
- type JustMainVoteConflict
- type JustMainVoteNoConflict
- type JustPreVoteHard
- type JustPreVoteSoft
- type JustType
- type Type
- type Vote
- func NewCPDecidedVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, ...) *Vote
- func NewCPMainVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, ...) *Vote
- func NewCPPreVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, ...) *Vote
- func NewPrecommitVote(blockHash hash.Hash, height uint32, round int16, signer crypto.Address) *Vote
- func NewPrepareVote(blockHash hash.Hash, height uint32, round int16, signer crypto.Address) *Vote
- func (v *Vote) BasicCheck() error
- func (v *Vote) BlockHash() hash.Hash
- func (v *Vote) CPJust() Just
- func (v *Vote) CPRound() int16
- func (v *Vote) CPValue() CPValue
- func (v *Vote) Hash() hash.Hash
- func (v *Vote) Height() uint32
- func (v *Vote) IsCPVote() bool
- func (v *Vote) MarshalCBOR() ([]byte, error)
- func (v *Vote) Round() int16
- func (v *Vote) SetSignature(sig *bls.Signature)
- func (v *Vote) SignBytes() []byte
- func (v *Vote) Signature() *bls.Signature
- func (v *Vote) Signer() crypto.Address
- func (v *Vote) String() string
- func (v *Vote) Type() Type
- func (v *Vote) UnmarshalCBOR(bs []byte) error
- func (v *Vote) Verify(pubKey *bls.PublicKey) error
Constants ¶
const ( JustTypeInitZero = JustType(1) JustTypeInitOne = JustType(2) JustTypePreVoteSoft = JustType(3) JustTypePreVoteHard = JustType(4) JustTypeMainVoteConflict = JustType(5) JustTypeMainVoteNoConflict = JustType(6) JustTypeDecided = JustType(7) )
const ( CPValueZero = CPValue(0) CPValueOne = CPValue(1) CPValueAbstain = CPValue(2) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicCheckError ¶ added in v0.15.0
type BasicCheckError struct {
Reason string
}
BasicCheckError is returned when the basic check on the transaction fails.
func (BasicCheckError) Error ¶ added in v0.15.0
func (e BasicCheckError) Error() string
type InvalidSignerError ¶ added in v0.15.0
InvalidSignerError is returned when the vote signer does not match with the public key.
func (InvalidSignerError) Error ¶ added in v0.15.0
func (e InvalidSignerError) Error() string
type JustDecided ¶ added in v0.15.1
type JustDecided struct {
QCert *certificate.Certificate `cbor:"1,keyasint"`
}
func (*JustDecided) BasicCheck ¶ added in v0.15.1
func (j *JustDecided) BasicCheck() error
func (*JustDecided) Type ¶ added in v0.15.1
func (j *JustDecided) Type() JustType
type JustInitOne ¶ added in v0.15.0
type JustInitOne struct { }
func (*JustInitOne) BasicCheck ¶ added in v0.15.0
func (j *JustInitOne) BasicCheck() error
func (*JustInitOne) Type ¶ added in v0.15.0
func (j *JustInitOne) Type() JustType
type JustInitZero ¶ added in v0.15.0
type JustInitZero struct {
QCert *certificate.Certificate `cbor:"1,keyasint"`
}
func (*JustInitZero) BasicCheck ¶ added in v0.15.0
func (j *JustInitZero) BasicCheck() error
func (*JustInitZero) Type ¶ added in v0.15.0
func (j *JustInitZero) Type() JustType
type JustMainVoteConflict ¶ added in v0.15.0
func (*JustMainVoteConflict) BasicCheck ¶ added in v0.15.0
func (j *JustMainVoteConflict) BasicCheck() error
func (*JustMainVoteConflict) Type ¶ added in v0.15.0
func (j *JustMainVoteConflict) Type() JustType
type JustMainVoteNoConflict ¶ added in v0.15.0
type JustMainVoteNoConflict struct {
QCert *certificate.Certificate `cbor:"1,keyasint"`
}
func (*JustMainVoteNoConflict) BasicCheck ¶ added in v0.15.0
func (j *JustMainVoteNoConflict) BasicCheck() error
func (*JustMainVoteNoConflict) Type ¶ added in v0.15.0
func (j *JustMainVoteNoConflict) Type() JustType
type JustPreVoteHard ¶ added in v0.15.0
type JustPreVoteHard struct {
QCert *certificate.Certificate `cbor:"1,keyasint"`
}
func (*JustPreVoteHard) BasicCheck ¶ added in v0.15.0
func (j *JustPreVoteHard) BasicCheck() error
func (*JustPreVoteHard) Type ¶ added in v0.15.0
func (j *JustPreVoteHard) Type() JustType
type JustPreVoteSoft ¶ added in v0.15.0
type JustPreVoteSoft struct {
QCert *certificate.Certificate `cbor:"1,keyasint"`
}
func (*JustPreVoteSoft) BasicCheck ¶ added in v0.15.0
func (j *JustPreVoteSoft) BasicCheck() error
func (*JustPreVoteSoft) Type ¶ added in v0.15.0
func (j *JustPreVoteSoft) Type() JustType
type Vote ¶
type Vote struct {
// contains filtered or unexported fields
}
Vote is a struct that represents a consensus vote.
func NewCPDecidedVote ¶ added in v0.15.1
func NewCPDecidedVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, cpValue CPValue, just Just, signer crypto.Address, ) *Vote
NewCPDecidedVote creates a new cp:Decided with the specified parameters.
func NewCPMainVote ¶ added in v0.15.0
func NewCPMainVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, cpValue CPValue, just Just, signer crypto.Address, ) *Vote
NewCPMainVote creates a new cp:MAIN-VOTE with the specified parameters.
func NewCPPreVote ¶ added in v0.15.0
func NewCPPreVote(blockHash hash.Hash, height uint32, round int16, cpRound int16, cpValue CPValue, just Just, signer crypto.Address, ) *Vote
NewCPPreVote creates a new cp:PRE-VOTE with the specified parameters.
func NewPrecommitVote ¶ added in v0.15.0
NewPrecommitVote creates a new PRECOMMIT with the specified parameters.
func NewPrepareVote ¶ added in v0.15.0
NewPrepareVote creates a new PREPARE with the specified parameters.
func (*Vote) BasicCheck ¶ added in v0.15.0
BasicCheck performs a basic check on the vote.
func (*Vote) CPJust ¶ added in v0.15.0
CPValue returns the change proposer justification for the vote.
func (*Vote) MarshalCBOR ¶
MarshalCBOR marshals the vote into CBOR format.
func (*Vote) SetSignature ¶
SetSignature sets the signature of the vote.
func (*Vote) UnmarshalCBOR ¶
UnmarshalCBOR unmarshals the vote from CBOR format.