Documentation ¶
Index ¶
- type BasicCheckError
- type BlockCertificate
- func (cert *BlockCertificate) Absentees() []int32
- func (cert *BlockCertificate) AddSignature(valNum int32, sig *bls.Signature)
- func (cert *BlockCertificate) BasicCheck() error
- func (cert *BlockCertificate) Clone() *BlockCertificate
- func (cert *BlockCertificate) Committers() []int32
- func (cert *BlockCertificate) Decode(r io.Reader) error
- func (cert *BlockCertificate) Encode(w io.Writer) error
- func (cert *BlockCertificate) Hash() hash.Hash
- func (cert *BlockCertificate) Height() uint32
- func (cert *BlockCertificate) MarshalCBOR() ([]byte, error)
- func (cert *BlockCertificate) Round() int16
- func (cert *BlockCertificate) SerializeSize() int
- func (cert *BlockCertificate) SetSignature(committers, absentees []int32, signature *bls.Signature)
- func (cert *BlockCertificate) SignBytes(blockHash hash.Hash) []byte
- func (cert *BlockCertificate) Signature() *bls.Signature
- func (cert *BlockCertificate) UnmarshalCBOR(bs []byte) error
- func (cert *BlockCertificate) Validate(validators []*validator.Validator, blockHash hash.Hash) error
- type InsufficientPowerError
- type UnexpectedCommittersError
- type VoteCertificate
- func (cert *VoteCertificate) Absentees() []int32
- func (cert *VoteCertificate) AddSignature(valNum int32, sig *bls.Signature)
- func (cert *VoteCertificate) BasicCheck() error
- func (cert *VoteCertificate) Committers() []int32
- func (cert *VoteCertificate) Decode(r io.Reader) error
- func (cert *VoteCertificate) Encode(w io.Writer) error
- func (cert *VoteCertificate) Hash() hash.Hash
- func (cert *VoteCertificate) Height() uint32
- func (cert *VoteCertificate) MarshalCBOR() ([]byte, error)
- func (cert *VoteCertificate) Round() int16
- func (cert *VoteCertificate) SerializeSize() int
- func (cert *VoteCertificate) SetSignature(committers, absentees []int32, signature *bls.Signature)
- func (cert *VoteCertificate) SignBytes(blockHash hash.Hash, extraData ...[]byte) []byte
- func (cert *VoteCertificate) Signature() *bls.Signature
- func (cert *VoteCertificate) UnmarshalCBOR(bs []byte) error
- func (cert *VoteCertificate) ValidateCPMainVote(validators []*validator.Validator, blockHash hash.Hash, cpRound int16, ...) error
- func (cert *VoteCertificate) ValidateCPPreVote(validators []*validator.Validator, blockHash hash.Hash, cpRound int16, ...) error
- func (cert *VoteCertificate) ValidatePrepare(validators []*validator.Validator, blockHash hash.Hash) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicCheckError ¶
type BasicCheckError struct {
Reason string
}
BasicCheckError is returned when the basic check on the certificate fails.
func (BasicCheckError) Error ¶
func (e BasicCheckError) Error() string
type BlockCertificate ¶ added in v1.2.0
type BlockCertificate struct {
// contains filtered or unexported fields
}
BlockCertificate represents a certificate used for block validation, verifying if a block is signed by a majority of validators.
func NewBlockCertificate ¶ added in v1.2.0
func NewBlockCertificate(height uint32, round int16) *BlockCertificate
NewBlockCertificate creates a new BlockCertificate.
func (*BlockCertificate) Absentees ¶ added in v1.2.0
func (cert *BlockCertificate) Absentees() []int32
func (*BlockCertificate) AddSignature ¶ added in v1.2.0
AddSignature adds a new signature to the certificate. It does not check the validity of the signature. The caller should ensure that the signature is valid.
func (*BlockCertificate) BasicCheck ¶ added in v1.2.0
func (cert *BlockCertificate) BasicCheck() error
func (*BlockCertificate) Clone ¶ added in v1.2.0
func (cert *BlockCertificate) Clone() *BlockCertificate
func (*BlockCertificate) Committers ¶ added in v1.2.0
func (cert *BlockCertificate) Committers() []int32
func (*BlockCertificate) MarshalCBOR ¶ added in v1.2.0
func (*BlockCertificate) SerializeSize ¶ added in v1.2.0
func (cert *BlockCertificate) SerializeSize() int
SerializeSize returns the number of bytes it would take to serialize the block.
func (*BlockCertificate) SetSignature ¶ added in v1.2.0
func (*BlockCertificate) SignBytes ¶ added in v1.2.0
func (cert *BlockCertificate) SignBytes(blockHash hash.Hash) []byte
func (*BlockCertificate) UnmarshalCBOR ¶ added in v1.2.0
type InsufficientPowerError ¶
InsufficientPowerError is returned when the accumulated power does not meet the required threshold.
func (InsufficientPowerError) Error ¶
func (e InsufficientPowerError) Error() string
type UnexpectedCommittersError ¶
type UnexpectedCommittersError struct {
Committers []int32
}
UnexpectedCommittersError is returned when the list of committers does not match the expectations.
func (UnexpectedCommittersError) Error ¶
func (e UnexpectedCommittersError) Error() string
func (UnexpectedCommittersError) Is ¶
func (e UnexpectedCommittersError) Is(target error) bool
type VoteCertificate ¶ added in v1.2.0
type VoteCertificate struct {
// contains filtered or unexported fields
}
VoteCertificate represents a certificate used for consensus voting, checking if a majority of validators have voted in a consensus step.
func NewVoteCertificate ¶ added in v1.2.0
func NewVoteCertificate(height uint32, round int16) *VoteCertificate
NewVoteCertificate creates a new VoteCertificate instance.
func (*VoteCertificate) Absentees ¶ added in v1.2.0
func (cert *VoteCertificate) Absentees() []int32
func (*VoteCertificate) AddSignature ¶ added in v1.2.0
AddSignature adds a new signature to the certificate. It does not check the validity of the signature. The caller should ensure that the signature is valid.
func (*VoteCertificate) BasicCheck ¶ added in v1.2.0
func (cert *VoteCertificate) BasicCheck() error
func (*VoteCertificate) Committers ¶ added in v1.2.0
func (cert *VoteCertificate) Committers() []int32
func (*VoteCertificate) MarshalCBOR ¶ added in v1.2.0
func (*VoteCertificate) SerializeSize ¶ added in v1.2.0
func (cert *VoteCertificate) SerializeSize() int
SerializeSize returns the number of bytes it would take to serialize the block.
func (*VoteCertificate) SetSignature ¶ added in v1.2.0
func (*VoteCertificate) SignBytes ¶ added in v1.2.0
func (cert *VoteCertificate) SignBytes(blockHash hash.Hash, extraData ...[]byte) []byte
SignBytes returns the sign bytes for the vote certificate. This method provides the same data as the `SignBytes` function in vote struct.