cosmos-sdk/x/staking/alias.go
frog power 4000 3fe5869148
Merge PR #4159: Module/Genesis Generalization
* first commit

* gaia cleanup

* ...

* staking multihooks

* missing module function return args

* bank module name constant

* working, module interface for x/

* got this thing compiling

* make test compiles and passes

* remove expanded simulation invariants

* genesis issue

* continued

* continued

* register crisis routes thought mm

* begin blocker to mm

* end blocker to mm

* empty routes not initialized

* move gaia initChainer sanity check to baseapp

* remove codecs from module manager

* reorging genesis stuff

* module manager passed by reference/bugfixes from working last commit

int

int

* move invariant checks from gaia to crisis

* typo

* basic refactors cmd/gaia/init

* working

* MultiStakingHooks from types to x/staking/types

int

* default module manager order of operations from input modules

* working

* typo

* add AppModuleBasic

* moduleBasicManager / non-test code compiles

* working attempting to get tests passing

* make test passes

* sim random genesis fix

* export bug

* ...

* genutil module

* genutil working

* refactored - happy with non-testing code in cmd/

* ...

* lint fixes

* comment improvement

* cli test fix

* compile housing

* working through compile errors

* working gettin' compilin'

* non-test code compiles

* move testnet to its own module

* reworking tests

int

* bez staging PR 1 comments

* concise module function-of names

* moved all tests from genesis_test.go to other genutil tests

* genaccounts package, add genutil and genaccounts to app.go

* docs for genutil genaccounts

* genaccounts iterate fn

* non-test code with genaccounts/ now compiles

* working test compiling

* debugging tests

* resolved all make test compile errors

* test debuggin

* resolved all unit tests, introduced param module

* cli-test compile fixes

* staking initialization bug

* code comment improvements, changelog entries

* BasicGaiaApp -> ModuleBasics

* highlevel explanation in types/module.go

* @alexanderbez comment revisions

* @fedekunze PR comments

* @alexanderbez PR comments (x2)

* @cwgoes comments (minor updates)

* @fedekunze suggestions

* panic on init with multiple validator updates from different modules

* initchain panic makes validate genesis fail

int

* AppModuleGenesis seperation

int

* test

* remove init panic logic in validate genesis replaced with TODO

* set maxprocs to match system's GOMAXPROCS

* Update circleci

* Cap maxprocs in CI to 4

* @alexanderbez recent comments addressed

* less blocks in twouble sims

int

* runsim error output flag

* -e on import_export as well

* error out

int

* Try to fix failures

* runsim
2019-05-16 11:25:32 -04:00

186 lines
8.5 KiB
Go

// nolint
package staking
import (
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/cosmos-sdk/x/staking/querier"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
type (
Keeper = keeper.Keeper
FeeCollectionKeeper = types.FeeCollectionKeeper
BankKeeper = types.BankKeeper
DistributionKeeper = types.DistributionKeeper
AccountKeeper = types.AccountKeeper
Validator = types.Validator
Validators = types.Validators
Description = types.Description
Commission = types.Commission
CommissionMsg = types.CommissionMsg
Delegation = types.Delegation
DelegationResp = types.DelegationResponse
DelegationResponses = types.DelegationResponses
Delegations = types.Delegations
UnbondingDelegation = types.UnbondingDelegation
UnbondingDelegations = types.UnbondingDelegations
Redelegation = types.Redelegation
Redelegations = types.Redelegations
RedelegationResponses = types.RedelegationResponses
Params = types.Params
Pool = types.Pool
MultiStakingHooks = types.MultiStakingHooks
MsgCreateValidator = types.MsgCreateValidator
MsgEditValidator = types.MsgEditValidator
MsgDelegate = types.MsgDelegate
MsgUndelegate = types.MsgUndelegate
MsgBeginRedelegate = types.MsgBeginRedelegate
GenesisState = types.GenesisState
QueryDelegatorParams = querier.QueryDelegatorParams
QueryValidatorParams = querier.QueryValidatorParams
QueryBondsParams = querier.QueryBondsParams
QueryRedelegationParams = querier.QueryRedelegationParams
QueryValidatorsParams = querier.QueryValidatorsParams
)
var (
NewKeeper = keeper.NewKeeper
GetValidatorKey = keeper.GetValidatorKey
GetValidatorByConsAddrKey = keeper.GetValidatorByConsAddrKey
GetValidatorsByPowerIndexKey = keeper.GetValidatorsByPowerIndexKey
GetDelegationKey = keeper.GetDelegationKey
GetDelegationsKey = keeper.GetDelegationsKey
PoolKey = keeper.PoolKey
LastValidatorPowerKey = keeper.LastValidatorPowerKey
LastTotalPowerKey = keeper.LastTotalPowerKey
ValidatorsKey = keeper.ValidatorsKey
ValidatorsByConsAddrKey = keeper.ValidatorsByConsAddrKey
ValidatorsByPowerIndexKey = keeper.ValidatorsByPowerIndexKey
DelegationKey = keeper.DelegationKey
GetUBDKey = keeper.GetUBDKey
GetUBDByValIndexKey = keeper.GetUBDByValIndexKey
GetUBDsKey = keeper.GetUBDsKey
GetUBDsByValIndexKey = keeper.GetUBDsByValIndexKey
GetREDKey = keeper.GetREDKey
GetREDByValSrcIndexKey = keeper.GetREDByValSrcIndexKey
GetREDByValDstIndexKey = keeper.GetREDByValDstIndexKey
GetREDsKey = keeper.GetREDsKey
GetREDsFromValSrcIndexKey = keeper.GetREDsFromValSrcIndexKey
GetREDsToValDstIndexKey = keeper.GetREDsToValDstIndexKey
GetREDsByDelToValDstIndexKey = keeper.GetREDsByDelToValDstIndexKey
TestingUpdateValidator = keeper.TestingUpdateValidator
UnbondingQueueKey = keeper.UnbondingQueueKey
RedelegationQueueKey = keeper.RedelegationQueueKey
ValidatorQueueKey = keeper.ValidatorQueueKey
RegisterInvariants = keeper.RegisterInvariants
AllInvariants = keeper.AllInvariants
SupplyInvariants = keeper.SupplyInvariants
NonNegativePowerInvariant = keeper.NonNegativePowerInvariant
PositiveDelegationInvariant = keeper.PositiveDelegationInvariant
DelegatorSharesInvariant = keeper.DelegatorSharesInvariant
DefaultParamspace = keeper.DefaultParamspace
KeyUnbondingTime = types.KeyUnbondingTime
KeyMaxValidators = types.KeyMaxValidators
KeyBondDenom = types.KeyBondDenom
ModuleCdc = types.ModuleCdc
DefaultParams = types.DefaultParams
NewParams = types.NewParams
InitialPool = types.InitialPool
NewValidator = types.NewValidator
NewDescription = types.NewDescription
NewCommission = types.NewCommission
NewCommissionMsg = types.NewCommissionMsg
NewCommissionWithTime = types.NewCommissionWithTime
NewGenesisState = types.NewGenesisState
DefaultGenesisState = types.DefaultGenesisState
RegisterCodec = types.RegisterCodec
NewMultiStakingHooks = types.NewMultiStakingHooks
NewMsgCreateValidator = types.NewMsgCreateValidator
NewMsgEditValidator = types.NewMsgEditValidator
NewMsgDelegate = types.NewMsgDelegate
NewMsgUndelegate = types.NewMsgUndelegate
NewMsgBeginRedelegate = types.NewMsgBeginRedelegate
NewQuerier = querier.NewQuerier
NewQueryDelegatorParams = querier.NewQueryDelegatorParams
NewQueryValidatorParams = querier.NewQueryValidatorParams
NewQueryBondsParams = querier.NewQueryBondsParams
NewQueryValidatorsParams = querier.NewQueryValidatorsParams
NewQueryRedelegationParams = querier.NewQueryRedelegationParams
)
const (
QueryValidators = querier.QueryValidators
QueryValidator = querier.QueryValidator
QueryValidatorDelegations = querier.QueryValidatorDelegations
QueryValidatorRedelegations = querier.QueryValidatorRedelegations
QueryValidatorUnbondingDelegations = querier.QueryValidatorUnbondingDelegations
QueryDelegation = querier.QueryDelegation
QueryUnbondingDelegation = querier.QueryUnbondingDelegation
QueryDelegatorDelegations = querier.QueryDelegatorDelegations
QueryDelegatorUnbondingDelegations = querier.QueryDelegatorUnbondingDelegations
QueryRedelegations = querier.QueryRedelegations
QueryDelegatorValidators = querier.QueryDelegatorValidators
QueryDelegatorValidator = querier.QueryDelegatorValidator
QueryPool = querier.QueryPool
QueryParameters = querier.QueryParameters
)
const (
ModuleName = types.ModuleName
StoreKey = types.StoreKey
TStoreKey = types.TStoreKey
QuerierRoute = types.QuerierRoute
RouterKey = types.RouterKey
DefaultCodespace = types.DefaultCodespace
CodeInvalidValidator = types.CodeInvalidValidator
CodeInvalidDelegation = types.CodeInvalidDelegation
CodeInvalidInput = types.CodeInvalidInput
CodeValidatorJailed = types.CodeValidatorJailed
CodeUnauthorized = types.CodeUnauthorized
CodeInternal = types.CodeInternal
CodeUnknownRequest = types.CodeUnknownRequest
)
var (
ErrNilValidatorAddr = types.ErrNilValidatorAddr
ErrNoValidatorFound = types.ErrNoValidatorFound
ErrValidatorOwnerExists = types.ErrValidatorOwnerExists
ErrValidatorPubKeyExists = types.ErrValidatorPubKeyExists
ErrValidatorPubKeyTypeUnsupported = types.ErrValidatorPubKeyTypeNotSupported
ErrValidatorJailed = types.ErrValidatorJailed
ErrBadRemoveValidator = types.ErrBadRemoveValidator
ErrDescriptionLength = types.ErrDescriptionLength
ErrCommissionNegative = types.ErrCommissionNegative
ErrCommissionHuge = types.ErrCommissionHuge
ErrNilDelegatorAddr = types.ErrNilDelegatorAddr
ErrBadDenom = types.ErrBadDenom
ErrBadDelegationAmount = types.ErrBadDelegationAmount
ErrNoDelegation = types.ErrNoDelegation
ErrBadDelegatorAddr = types.ErrBadDelegatorAddr
ErrNoDelegatorForAddress = types.ErrNoDelegatorForAddress
ErrInsufficientShares = types.ErrInsufficientShares
ErrDelegationValidatorEmpty = types.ErrDelegationValidatorEmpty
ErrNotEnoughDelegationShares = types.ErrNotEnoughDelegationShares
ErrBadSharesAmount = types.ErrBadSharesAmount
ErrBadSharesPercent = types.ErrBadSharesPercent
ErrNotMature = types.ErrNotMature
ErrNoUnbondingDelegation = types.ErrNoUnbondingDelegation
ErrNoRedelegation = types.ErrNoRedelegation
ErrBadRedelegationDst = types.ErrBadRedelegationDst
ErrBothShareMsgsGiven = types.ErrBothShareMsgsGiven
ErrNeitherShareMsgsGiven = types.ErrNeitherShareMsgsGiven
ErrMissingSignature = types.ErrMissingSignature
ErrMinSelfDelegationInvalid = types.ErrMinSelfDelegationInvalid
ErrMinSelfDelegationDecreased = types.ErrMinSelfDelegationDecreased
ErrSelfDelegationBelowMinimum = types.ErrSelfDelegationBelowMinimum
)