certificate

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockCertificateSignBytes

func BlockCertificateSignBytes(blockHash hash.Hash, height uint32, round int16) []byte

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 Certificate

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

func NewCertificate

func NewCertificate(height uint32, round int16, committers, absentees []int32, signature *bls.Signature) *Certificate

func (*Certificate) Absentees

func (cert *Certificate) Absentees() []int32

func (*Certificate) AddSignature

func (cert *Certificate) AddSignature(valNum int32, sig *bls.Signature)

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 (*Certificate) BasicCheck

func (cert *Certificate) BasicCheck() error

func (*Certificate) Clone

func (cert *Certificate) Clone() *Certificate

func (*Certificate) Committers

func (cert *Certificate) Committers() []int32

func (*Certificate) Decode

func (cert *Certificate) Decode(r io.Reader) error

func (*Certificate) Encode

func (cert *Certificate) Encode(w io.Writer) error

func (*Certificate) Hash

func (cert *Certificate) Hash() hash.Hash

func (*Certificate) Height

func (cert *Certificate) Height() uint32

func (*Certificate) MarshalCBOR

func (cert *Certificate) MarshalCBOR() ([]byte, error)

func (*Certificate) Round

func (cert *Certificate) Round() int16

func (*Certificate) SerializeSize

func (cert *Certificate) SerializeSize() int

SerializeSize returns the number of bytes it would take to serialize the block.

func (*Certificate) Signature

func (cert *Certificate) Signature() *bls.Signature

func (*Certificate) UnmarshalCBOR

func (cert *Certificate) UnmarshalCBOR(bs []byte) error

func (*Certificate) Validate

func (cert *Certificate) Validate(height uint32,
	validators []*validator.Validator, signBytes []byte,
) error

type InsufficientPowerError

type InsufficientPowerError struct {
	SignedPower   int64
	RequiredPower int64
}

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 (UnexpectedCommittersError) Is

func (e UnexpectedCommittersError) Is(target error) bool

type UnexpectedHeightError

type UnexpectedHeightError struct {
	Expected uint32
	Got      uint32
}

UnexpectedHeightError is returned when the height of the certificate is invalid.

func (UnexpectedHeightError) Error

func (e UnexpectedHeightError) Error() string

Jump to

Keyboard shortcuts

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