Versions in this module Expand all Collapse all v1 v1.9.8 Jun 28, 2023 Changes in this version + var AnycastID = ids.ID + var ErrInsufficientWeight = errors.New("signature weight is insufficient") + var ErrInvalidBitSet = errors.New("bitset is invalid") + var ErrInvalidSignature = errors.New("signature is invalid") + var ErrParseSignature = errors.New("failed to parse signature") + var ErrUnknownValidator = errors.New("unknown validator") + var ErrWeightOverflow = errors.New("weight overflowed") + var SignerTests = []func(t *testing.T, s Signer, sk *bls.SecretKey, chainID ids.ID) + func AggregatePublicKeys(vdrs []*Validator) (*bls.PublicKey, error) + func SumWeight(vdrs []*Validator) (uint64, error) + func TestSignerVerifies(t *testing.T, s Signer, sk *bls.SecretKey, chainID ids.ID) + func TestSignerWrongChainID(t *testing.T, s Signer, _ *bls.SecretKey, _ ids.ID) + func VerifyWeight(sigWeight uint64, totalWeight uint64, quorumNum uint64, quorumDen uint64) error + type BitSetSignature struct + Signature [bls.SignatureLen]byte + Signers []byte + func (s *BitSetSignature) Verify(ctx context.Context, msg *UnsignedMessage, pChainState validators.State, ...) error + type Message struct + Signature Signature + func NewMessage(unsignedMsg *UnsignedMessage, signature Signature) (*Message, error) + func ParseMessage(b []byte) (*Message, error) + func (m *Message) Bytes() []byte + func (m *Message) Initialize() error + type Signature interface + Verify func(ctx context.Context, msg *UnsignedMessage, pChainState validators.State, ...) error + type Signer interface + Sign func(msg *UnsignedMessage) ([]byte, error) + func NewSigner(sk *bls.SecretKey, chainID ids.ID) Signer + type UnsignedMessage struct + DestinationChainID ids.ID + Payload []byte + SourceChainID ids.ID + func NewUnsignedMessage(sourceChainID ids.ID, destinationChainID ids.ID, payload []byte) (*UnsignedMessage, error) + func ParseUnsignedMessage(b []byte) (*UnsignedMessage, error) + func (m *UnsignedMessage) Bytes() []byte + func (m *UnsignedMessage) Initialize() error + type Validator struct + NodeIDs []ids.NodeID + PublicKey *bls.PublicKey + PublicKeyBytes []byte + Weight uint64 + func FilterValidators(indices set.Bits, vdrs []*Validator) ([]*Validator, error) + func GetCanonicalValidatorSet(ctx context.Context, pChainState validators.State, pChainHeight uint64, ...) ([]*Validator, uint64, error) + func (v *Validator) Less(o *Validator) bool v1.9.8-rc.9 Jun 28, 2023