keeper

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryUpgradeConfig        = "config"
	QueryUpgradeVersion       = "version"
	QueryUpgradeFailedVersion = "failed_version"
)

const

Variables

This section is empty.

Functions

func NewAppUpgradeProposalHandler

func NewAppUpgradeProposalHandler(k *Keeper) gov.Handler

NewAppUpgradeProposalHandler creates a new upgrade handler for gov module

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type BankKeeper

type BankKeeper interface {
	GetCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper shows the expected action of bank keeper in this module

type Keeper

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

Keeper is the keeper struct of the upgrade store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, pk ProtocolKeeper, sk StakingKeeper, ck BankKeeper,
	paramSpace params.Subspace) Keeper

NewKeeper creates a new upgrade keeper

func (Keeper) AddNewVersionInfo

func (k Keeper) AddNewVersionInfo(ctx sdk.Context, versionInfo types.VersionInfo)

AddNewVersionInfo adds new version info

func (Keeper) AfterDepositPeriodPassed

func (Keeper) AfterDepositPeriodPassed(_ sdk.Context, _ gov.Proposal)

func (Keeper) AfterSubmitProposalHandler

func (Keeper) AfterSubmitProposalHandler(_ sdk.Context, _ gov.Proposal)

func (Keeper) CheckMsgSubmitProposal

func (k Keeper) CheckMsgSubmitProposal(ctx sdk.Context, msg gov.MsgSubmitProposal) sdk.Error

CheckMsgSubmitProposal implements ProposalHandler interface

func (Keeper) ClearSignals

func (k Keeper) ClearSignals(ctx sdk.Context, protocol uint64)

ClearSignals cleans up signals

func (Keeper) ClearUpgradeConfig

func (k Keeper) ClearUpgradeConfig(ctx sdk.Context)

ClearUpgradeConfig clears upgrade config

func (Keeper) DeleteSignal

func (k Keeper) DeleteSignal(ctx sdk.Context, protocol uint64, address string) bool

DeleteSignal removes signal

func (Keeper) GetAppUpgradeConfig

func (k Keeper) GetAppUpgradeConfig(ctx sdk.Context) (proto.AppUpgradeConfig, bool)

GetAppUpgradeConfig gets app upgrade config

func (Keeper) GetCurrentVersion

func (k Keeper) GetCurrentVersion(ctx sdk.Context) uint64

GetCurrentVersion gets current version

func (Keeper) GetMaxDepositPeriod

func (k Keeper) GetMaxDepositPeriod(ctx sdk.Context, content gov.Content) (maxDepositPeriod time.Duration)

GetMaxDepositPeriod implements ProposalHandler interface

func (Keeper) GetMinDeposit

func (k Keeper) GetMinDeposit(ctx sdk.Context, content gov.Content) (minDeposit sdk.DecCoins)

GetMinDeposit implements ProposalHandler interface

func (Keeper) GetParams

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

GetParams gets inflation params from the global param store

func (Keeper) GetProtocolKeeper

func (k Keeper) GetProtocolKeeper() ProtocolKeeper

GetProtocolKeeper gets proto keeper

func (Keeper) GetSignal

func (k Keeper) GetSignal(ctx sdk.Context, protocol uint64, address string) bool

GetSignal gets signal

func (Keeper) GetValidatorByConsAddr

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

GetValidatorByConsAddr gets validator by its consensus address

func (Keeper) GetVotingPeriod

func (k Keeper) GetVotingPeriod(ctx sdk.Context, content gov.Content) (votingPeriod time.Duration)

GetVotingPeriod implements ProposalHandler interface

func (Keeper) IterateBondedValidatorsByPower

func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context,
	fn func(index int64, validator exported.ValidatorI) (stop bool))

IterateBondedValidatorsByPower iterates bonded validators by power

func (Keeper) RejectedHandler

func (Keeper) RejectedHandler(_ sdk.Context, _ gov.Content)

func (Keeper) SetAppUpgradeConfig

func (k Keeper) SetAppUpgradeConfig(ctx sdk.Context, proposalID, version, upgradeHeight uint64, software string,
) sdk.Error

SetAppUpgradeConfig sets app upgrade config for test deprecated

func (Keeper) SetCurrentVersion

func (k Keeper) SetCurrentVersion(ctx sdk.Context, currentVersion uint64)

SetCurrentVersion sets current version to store

func (Keeper) SetLastFailedVersion

func (k Keeper) SetLastFailedVersion(ctx sdk.Context, lastFailedVersion uint64)

SetLastFailedVersion sets last failed version to store

func (Keeper) SetParams

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

SetParams sets upgrade params to store

func (Keeper) SetSignal

func (k Keeper) SetSignal(ctx sdk.Context, protocol uint64, address string)

SetSignal sets signal for upgrade

func (Keeper) VoteHandler

func (Keeper) VoteHandler(_ sdk.Context, _ gov.Proposal, _ gov.Vote) (string, sdk.Error)

nolint

type ProtocolKeeper

type ProtocolKeeper interface {
	IsValidVersion(ctx sdk.Context, version uint64) bool
	GetUpgradeConfigByStore(store sdk.KVStore) (upgradeConfig proto.AppUpgradeConfig, found bool)
	GetUpgradeConfig(ctx sdk.Context) (upgradeConfig proto.AppUpgradeConfig, found bool)
	SetUpgradeConfig(ctx sdk.Context, upgradeConfig proto.AppUpgradeConfig)
	GetCurrentVersion(ctx sdk.Context) uint64
	SetLastFailedVersion(ctx sdk.Context, lastFailedVersion uint64)
	SetCurrentVersion(ctx sdk.Context, currentVersion uint64)
	ClearUpgradeConfig(ctx sdk.Context)
	GetLastFailedVersion(ctx sdk.Context) uint64
}

ProtocolKeeper shows the expected action of proto keeper in this module

type StakingKeeper

type StakingKeeper interface {
	IsValidator(ctx sdk.Context, addr sdk.AccAddress) bool
	IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool))
	GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)
}

StakingKeeper shows the expected action of staking keeper in this module

Jump to

Keyboard shortcuts

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