keeper

package
v0.0.0-...-df65111 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for poa clients.

Types

type Keeper

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

Keeper of the poa store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramspace types.ParamSubspace) Keeper

NewKeeper creates a poa keeper

func (Keeper) AppendApplication

func (k Keeper) AppendApplication(ctx sdk.Context, candidate types.Validator)

Append a new application with a new vote

func (Keeper) AppendKickProposal

func (k Keeper) AppendKickProposal(ctx sdk.Context, candidate types.Validator)

Append a new kick proposal with a new vote

func (Keeper) AppendValidator

func (k Keeper) AppendValidator(ctx sdk.Context, validator types.Validator)

Append a validator and set its state to joining

func (Keeper) GetAllApplications

func (k Keeper) GetAllApplications(ctx sdk.Context) (applications []types.Vote)

Get the set of all application

func (Keeper) GetAllKickProposals

func (k Keeper) GetAllKickProposals(ctx sdk.Context) (kickProposals []types.Vote)

Get the set of all kick proposals

func (Keeper) GetAllValidators

func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)

Get the set of all validators

func (Keeper) GetApplication

func (k Keeper) GetApplication(ctx sdk.Context, addr sdk.ValAddress) (application types.Vote, found bool)

Get an application

func (Keeper) GetApplicationByConsAddr

func (k Keeper) GetApplicationByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (application types.Vote, found bool)

Get an application by consensus address

func (Keeper) GetKickProposal

func (k Keeper) GetKickProposal(ctx sdk.Context, addr sdk.ValAddress) (kickProposal types.Vote, found bool)

Get a kick proposal

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of poa parameters.

func (Keeper) GetValidator

func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool)

Get a validator

func (Keeper) GetValidatorByConsAddr

func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)

Get a validator by consensus address

func (Keeper) GetValidatorState

func (k Keeper) GetValidatorState(ctx sdk.Context, addr sdk.ValAddress) (state uint16, found bool)

Get a validator state

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MaxValidators

func (k Keeper) MaxValidators(ctx sdk.Context) (res uint16)

MaxValidators - Maximum number of validators

func (Keeper) Quorum

func (k Keeper) Quorum(ctx sdk.Context) (res uint16)

Quorum - Quorum percentage to add or remove validators

func (Keeper) RemoveApplication

func (k Keeper) RemoveApplication(ctx sdk.Context, address sdk.ValAddress)

Remove the application

func (Keeper) RemoveKickProposal

func (k Keeper) RemoveKickProposal(ctx sdk.Context, address sdk.ValAddress)

Remove the kick proposal

func (Keeper) RemoveValidator

func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress)

Remove the validator !!! This function should only be called by the end blocker to ensure the validator is removed from the Tendermint validator state !!! This function is called by the end blocker when the validator state is leaving

func (Keeper) SetApplication

func (k Keeper) SetApplication(ctx sdk.Context, application types.Vote)

Set application details

func (Keeper) SetApplicationByConsAddr

func (k Keeper) SetApplicationByConsAddr(ctx sdk.Context, application types.Vote)

Set application consensus address

func (Keeper) SetKickProposal

func (k Keeper) SetKickProposal(ctx sdk.Context, kickProposal types.Vote)

Set kick proposal details

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the poa parameters to the param space.

func (Keeper) SetValidator

func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)

Set validator details

func (Keeper) SetValidatorByConsAddr

func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator)

Set validator consensus address

func (Keeper) SetValidatorState

func (k Keeper) SetValidatorState(ctx sdk.Context, validator types.Validator, state uint16)

Set validator state

Jump to

Keyboard shortcuts

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