Documentation ¶
Index ¶
- type ImmutableState
- func (s *ImmutableState) AllCommittees(ctx context.Context) ([]*api.Committee, error)
- func (s *ImmutableState) Committee(ctx context.Context, kind api.CommitteeKind, runtimeID common.Namespace) (*api.Committee, error)
- func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*api.ConsensusParameters, error)
- func (s *ImmutableState) CurrentValidators(ctx context.Context) (map[signature.PublicKey]int64, error)
- func (s *ImmutableState) KindsCommittees(ctx context.Context, kinds []api.CommitteeKind) ([]*api.Committee, error)
- func (s *ImmutableState) PendingValidators(ctx context.Context) (map[signature.PublicKey]int64, error)
- type MutableState
- func (s *MutableState) DropCommittee(ctx context.Context, kind api.CommitteeKind, runtimeID common.Namespace) error
- func (s *MutableState) PutCommittee(ctx context.Context, c *api.Committee) error
- func (s *MutableState) PutCurrentValidators(ctx context.Context, validators map[signature.PublicKey]int64) error
- func (s *MutableState) PutPendingValidators(ctx context.Context, validators map[signature.PublicKey]int64) error
- func (s *MutableState) SetConsensusParameters(ctx context.Context, params *api.ConsensusParameters) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImmutableState ¶
type ImmutableState struct {
// contains filtered or unexported fields
}
ImmutableState is the immutable scheduler state wrapper.
func NewImmutableState ¶
func NewImmutableState(ctx context.Context, state abciAPI.ApplicationQueryState, version int64) (*ImmutableState, error)
func (*ImmutableState) AllCommittees ¶
AllCommittees returns a list of all elected committees.
func (*ImmutableState) Committee ¶
func (s *ImmutableState) Committee(ctx context.Context, kind api.CommitteeKind, runtimeID common.Namespace) (*api.Committee, error)
Committee returns a specific elected committee.
func (*ImmutableState) ConsensusParameters ¶
func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*api.ConsensusParameters, error)
ConsensusParameters returns scheduler consensus parameters.
func (*ImmutableState) CurrentValidators ¶
func (s *ImmutableState) CurrentValidators(ctx context.Context) (map[signature.PublicKey]int64, error)
CurrentValidators returns a list of current validators.
func (*ImmutableState) KindsCommittees ¶
func (s *ImmutableState) KindsCommittees(ctx context.Context, kinds []api.CommitteeKind) ([]*api.Committee, error)
KindsCommittees returns a list of all committees of specific kinds.
func (*ImmutableState) PendingValidators ¶
func (s *ImmutableState) PendingValidators(ctx context.Context) (map[signature.PublicKey]int64, error)
PendingValidators returns a list of pending validators.
type MutableState ¶
type MutableState struct { *ImmutableState // contains filtered or unexported fields }
MutableState is a mutable scheduler state wrapper.
func NewMutableState ¶
func NewMutableState(tree mkvs.KeyValueTree) *MutableState
NewMutableState creates a new mutable scheduler state wrapper.
func (*MutableState) DropCommittee ¶
func (s *MutableState) DropCommittee(ctx context.Context, kind api.CommitteeKind, runtimeID common.Namespace) error
DropCommittee removes an elected committee of a specific kind for a specific runtime.
func (*MutableState) PutCommittee ¶
PutCommittee sets an elected committee for a specific runtime.
func (*MutableState) PutCurrentValidators ¶
func (s *MutableState) PutCurrentValidators(ctx context.Context, validators map[signature.PublicKey]int64) error
PutCurrentValidators stores the current set of validators.
func (*MutableState) PutPendingValidators ¶
func (s *MutableState) PutPendingValidators(ctx context.Context, validators map[signature.PublicKey]int64) error
PutPendingValidators stores the pending set of validators.
func (*MutableState) SetConsensusParameters ¶
func (s *MutableState) SetConsensusParameters(ctx context.Context, params *api.ConsensusParameters) error
SetConsensusParameters sets the scheduler consensus parameters.