session

package
v0.0.3-rc-1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MembershipProof

type MembershipProof struct {
	// The session index on which the specific key is a member.
	SessionIndex sc.U32
	// Trie nodes of a merkle proof of session membership.
	TrieNodes sc.Sequence[sc.Sequence[sc.U8]]
	// The validator count of the session on which the specific key is a member.
	Validators sc.U32
}

Proof of membership of a specific key in a given session.

func DecodeMembershipProof

func DecodeMembershipProof(buffer *bytes.Buffer) (MembershipProof, error)

func (MembershipProof) Bytes

func (m MembershipProof) Bytes() []byte

func (MembershipProof) Encode

func (m MembershipProof) Encode(buffer *bytes.Buffer) error

func (MembershipProof) Session

func (m MembershipProof) Session() sc.U32

func (MembershipProof) ValidatorCount

func (m MembershipProof) ValidatorCount() sc.U32

type OneSessionHandler

type OneSessionHandler interface {
	KeyType() primitives.PublicKeyType
	KeyTypeId() [4]byte
	DecodeKey(buffer *bytes.Buffer) (primitives.Sr25519PublicKey, error)
	OnGenesisSession(validators sc.Sequence[primitives.Validator]) error
	// OnNewSession triggers once the session has changed.
	OnNewSession(changed bool, validators sc.Sequence[primitives.Validator], queuedValidators sc.Sequence[primitives.Validator]) error
	// OnBeforeSessionEnding notifies for the end of the session. Triggered before the end of the session.
	OnBeforeSessionEnding()
	// OnDisabled triggers hook for a disabled validator. Acts accordingly until a new session begins.
	OnDisabled(validatorIndex sc.U32)
}

Jump to

Keyboard shortcuts

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