state

package
v0.2103.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func (s *ImmutableState) AllCommittees(ctx context.Context) ([]*api.Committee, error)

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

func (s *MutableState) PutCommittee(ctx context.Context, c *api.Committee) error

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.

NOTE: This method must only be called from InitChain/EndBlock contexts.

Jump to

Keyboard shortcuts

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