Versions in this module Expand all Collapse all v0 v0.1.0 Jan 19, 2024 Changes in this version + const DefaultParamspace + var Addrs = createTestAddrs(500) + var InitMsd2000 = sdk.NewDec(2000) + var PKs = createTestPubKeys(500) + var SufficientInitBalance = int64(10000) + var TestChainID = "stkchainid" + func DelegationToDelegationResponse(ctx sdk.Context, k Keeper, del stakingtypes.Delegation) (stakingtypes.DelegationResponse, error) + func DelegationsToDelegationResponses(ctx sdk.Context, k Keeper, delegations stakingtypes.Delegations) (stakingtypes.DelegationResponses, error) + func DelegatorAddSharesInvariant(k Keeper) sdk.Invariant + func MakeTestCodec() *codec.Codec + func ModuleAccountInvariantsCustom(k Keeper) sdk.Invariant + func NewPubKey(pk string) (res crypto.PubKey) + func NewQuerier(k Keeper) sdk.Querier + func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, msdAmt sdk.Dec) types.MsgCreateValidator + func NewTestMsgDeposit(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Dec) types.MsgDeposit + func NonNegativePowerInvariantCustom(k Keeper) sdk.Invariant + func ParamKeyTable() params.KeyTable + func PositiveDelegatorInvariant(k Keeper) sdk.Invariant + func RegisterInvariantsCustom(ir sdk.InvariantRegistry, k Keeper) + func SimpleCheckValidator(t *testing.T, ctx sdk.Context, stkKeeper Keeper, vaAddr sdk.ValAddress, ...) *types.Validator + func SimulateWeight(tokens sdk.Dec) types.Shares + func TestAddr(addr string, bech string) sdk.AccAddress + func ValidatorByPowerIndexExists(ctx sdk.Context, keeper MockStakingKeeper, power []byte) bool + type Keeper struct + func NewKeeper(cdcMarshl *codec.CodecProxy, key sdk.StoreKey, supplyKeeper types.SupplyKeeper, ...) Keeper + func NewKeeperWithNoParam(cdcMarshl *codec.CodecProxy, key sdk.StoreKey, supplyKeeper types.SupplyKeeper, ...) Keeper + func (k *Keeper) SetHooks(sh types.StakingHooks) *Keeper + func (k Keeper) AddSharesAsMinSelfDelegation(ctx sdk.Context, delAddr sdk.AccAddress, validator *types.Validator, ...) (err error) + func (k Keeper) AddSharesToValidators(ctx sdk.Context, delAddr sdk.AccAddress, vals types.Validators, tokens sdk.Dec) (shares types.Shares, sdkErr error) + func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress) + func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) + func (k Keeper) AfterValidatorDestroyed(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) + func (k Keeper) AppendAbandonedValidatorAddrs(ctx sdk.Context, ConsAddr sdk.ConsAddress) + func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate) + func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress) + func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress) + func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) + func (k Keeper) BondDenom(_ sdk.Context) string + func (k Keeper) BondedRatio(ctx sdk.Context) sdk.Dec + func (k Keeper) CheckEnabled(ctx sdk.Context) bool + func (k Keeper) ClearProxy(ctx sdk.Context, proxyAddr sdk.AccAddress) + func (k Keeper) Codespace() string + func (k Keeper) CompleteUndelegation(ctx sdk.Context, delAddr sdk.AccAddress) (sdk.Dec, error) + func (k Keeper) Delegate(ctx sdk.Context, delAddr sdk.AccAddress, token sdk.SysCoin) error + func (k Keeper) Delegation(ctx sdk.Context, delAddr sdk.AccAddress, address2 sdk.ValAddress) exported.DelegatorI + func (k Keeper) Delegator(ctx sdk.Context, delAddr sdk.AccAddress) exported.DelegatorI + func (k Keeper) DelegatorDelegations(ctx sdk.Context, req *outtypes.QueryDelegatorDelegationsRequest) (*outtypes.QueryDelegatorDelegationsResponse, error) + func (k Keeper) DeleteAbandonedValidatorAddrs(ctx sdk.Context) + func (k Keeper) DeleteAddrByTimeKey(ctx sdk.Context, timestamp time.Time, delAddr sdk.AccAddress) + func (k Keeper) DeleteDelegator(ctx sdk.Context, delAddr sdk.AccAddress) + func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64) + func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) + func (k Keeper) DeleteProposeValidators(ctx sdk.Context) + func (k Keeper) DeleteShares(ctx sdk.Context, valAddr sdk.ValAddress, delAddr sdk.AccAddress) + func (k Keeper) DeleteUndelegating(ctx sdk.Context, delAddr sdk.AccAddress) + func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) + func (k Keeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator) + func (k Keeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) + func (k Keeper) DepositMinSelfDelegation(ctx sdk.Context, delAddr sdk.AccAddress, validator *types.Validator, ...) (err error) + func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation + func (k Keeper) GetAllValidators(ctx sdk.Context) (validators types.Validators) + func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool exported.ModuleAccountI) + func (k Keeper) GetDelegator(ctx sdk.Context, delAddr sdk.AccAddress) (delegator types.Delegator, found bool) + func (k Keeper) GetDelegatorUnbondingDelegations(ctx sdk.Context, delAddr sdk.AccAddress, page *query.PageRequest) (types.UnbondingDelegations, *query.PageResponse, error) + func (k Keeper) GetDelegatorsByProxy(ctx sdk.Context, proxyAddr sdk.AccAddress) (delAddrs []sdk.AccAddress) + func (k Keeper) GetEpoch(ctx sdk.Context) (epoch uint16) + func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (outtypes.HistoricalInfo, bool) + func (k Keeper) GetLastTotalPower(ctx sdk.Context) (power sdk.Int) + func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64) + func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []outtypes.Validator) + func (k Keeper) GetLastValidatorsByAddr(ctx sdk.Context) validatorsByAddr + func (k Keeper) GetLastValsAddedSharesExisted(ctx sdk.Context, delAddr sdk.AccAddress) (types.Validators, types.Shares) + func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool exported.ModuleAccountI) + func (k Keeper) GetOperAddrFromValidatorAddr(ctx sdk.Context, va string) (sdk.ValAddress, bool) + func (k Keeper) GetOperAndValidatorAddr(ctx sdk.Context) types.OVPairs + func (k Keeper) GetParams(ctx sdk.Context) types.Params + func (k Keeper) GetProposeValidators(ctx sdk.Context) map[[sdk.AddrLen]byte]bool + func (k Keeper) GetShares(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (types.Shares, bool) + func (k Keeper) GetTheEndOfLastEpoch(ctx sdk.Context) (height int64) + func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool) + func (k Keeper) GetUndelegating(ctx sdk.Context, delAddr sdk.AccAddress) (undelegationInfo types.UndelegationInfo, found bool) + func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool) + func (k Keeper) GetValidatorAllShares(ctx sdk.Context, valAddr sdk.ValAddress) types.SharesResponses + func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool) + func (k Keeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (valAddrs []sdk.ValAddress) + func (k Keeper) GetValidatorsToAddShares(ctx sdk.Context, valAddrs []sdk.ValAddress) (types.Validators, error) + func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32) + func (k Keeper) InsertValidatorQueue(ctx sdk.Context, val types.Validator) + func (k Keeper) IsEndOfEpoch(ctx sdk.Context) bool + func (k Keeper) IsKickedOut(ctx sdk.Context) bool + func (k Keeper) IsValidator(ctx sdk.Context, addr sdk.AccAddress) bool + func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...) + func (k Keeper) IterateDelegator(ctx sdk.Context, fn func(index int64, delegator types.Delegator) (stop bool)) + func (k Keeper) IterateKeysBeforeCurrentTime(ctx sdk.Context, currentTime time.Time, ...) + func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, ...) + func (k Keeper) IterateLastValidators(ctx sdk.Context, ...) + func (k Keeper) IterateProxy(ctx sdk.Context, proxyAddr sdk.AccAddress, isClear bool, ...) + func (k Keeper) IterateShares(ctx sdk.Context, ...) + func (k Keeper) IterateUndelegationInfo(ctx sdk.Context, ...) + func (k Keeper) IterateValidators(ctx sdk.Context, ...) + func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress) + func (k Keeper) KickOutAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate) + func (k Keeper) LastValidatorsIterator(ctx sdk.Context) (iterator sdk.Iterator) + func (k Keeper) Logger(ctx sdk.Context) log.Logger + func (k Keeper) MaxValidators(ctx sdk.Context) (res uint16) + func (k Keeper) ParamsConsensusType(ctx sdk.Context) (consensusType common.ConsensusType) + func (k Keeper) ParamsEnableDposOp(ctx sdk.Context) (enableDposOp bool) + func (k Keeper) ParamsEpoch(ctx sdk.Context) (res uint16) + func (k Keeper) ParamsMaxValsToAddShares(ctx sdk.Context) (num uint16) + func (k Keeper) ParamsMinDelegation(ctx sdk.Context) (num sdk.Dec) + func (k Keeper) ParamsMinSelfDelegation(ctx sdk.Context) (num sdk.Dec) + func (k Keeper) PoAApplyAndReturnValidatorSetUpdates(ctx sdk.Context, proposeValidators map[[sdk.AddrLen]byte]bool) (updates []abci.ValidatorUpdate) + func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress) + func (k Keeper) SetAddrByTimeKeyWithNilValue(ctx sdk.Context, timestamp time.Time, delAddr sdk.AccAddress) + func (k Keeper) SetDelegator(ctx sdk.Context, delegator types.Delegator) + func (k Keeper) SetEpoch(ctx sdk.Context, epoch uint16) + func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi outtypes.HistoricalInfo) + func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int) + func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64) + func (k Keeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) + func (k Keeper) SetParams(ctx sdk.Context, params types.Params) + func (k Keeper) SetProposeValidator(ctx sdk.Context, operator sdk.ValAddress, isAdd bool) + func (k Keeper) SetProxyBinding(ctx sdk.Context, proxyAddress, delegatorAddress sdk.AccAddress, isRemove bool) + func (k Keeper) SetShares(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) + func (k Keeper) SetTheEndOfLastEpoch(ctx sdk.Context) + func (k Keeper) SetUndelegating(ctx sdk.Context, undelegationInfo types.UndelegationInfo) + func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator) + func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) + func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) + func (k Keeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.ValAddress) + func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, ...) + func (k Keeper) StakingTokenSupply(ctx sdk.Context) sdk.Dec + func (k Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Dec + func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) + func (k Keeper) UnbondAllMatureValidatorQueue(ctx sdk.Context) + func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration) + func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress) + func (k Keeper) UpdateProxy(ctx sdk.Context, delegator types.Delegator, tokens sdk.Dec) (err error) + func (k Keeper) UpdateShares(ctx sdk.Context, delAddr sdk.AccAddress, tokens sdk.Dec) error + func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, validator types.Validator, newRate sdk.Dec) (types.Commission, error) + func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) exported.ValidatorI + func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) exported.ValidatorI + func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator + func (k Keeper) ValidatorsPowerStoreIterator(ctx sdk.Context) (iterator sdk.Iterator) + func (k Keeper) Withdraw(ctx sdk.Context, delAddr sdk.AccAddress, token sdk.SysCoin) (time.Time, error) + func (k Keeper) WithdrawLastShares(ctx sdk.Context, delAddr sdk.AccAddress, ...) + func (k Keeper) WithdrawMinSelfDelegation(ctx sdk.Context, delAddr sdk.AccAddress, validator types.Validator) (completionTime time.Time, err error) + type MockStakingKeeper struct + AccKeeper auth.AccountKeeper + MountedStore store.MultiStore + StoreKey sdk.StoreKey + SupplyKeeper supply.Keeper + TkeyStoreKey sdk.StoreKey + func CreateTestInput(t *testing.T, isCheckTx bool, initBalance int64) (sdk.Context, auth.AccountKeeper, MockStakingKeeper) + func NewMockStakingKeeper(k Keeper, keyStoreKey, tkeyStoreKey sdk.StoreKey, sKeeper supply.Keeper, ...) MockStakingKeeper + type Querier struct + func NewGrpcQuerier(k Keeper) *Querier + func (k Querier) Validators(c context.Context, req *typesadapter.QueryValidatorsRequest) (*typesadapter.QueryValidatorsResponse, error) + func (q *Querier) Delegation(ctx context.Context, request *typesadapter.QueryDelegationRequest) (*typesadapter.QueryDelegationResponse, error) + func (q *Querier) DelegatorDelegations(ctx context.Context, request *typesadapter.QueryDelegatorDelegationsRequest) (*typesadapter.QueryDelegatorDelegationsResponse, error) + func (q *Querier) DelegatorUnbondingDelegations(ctx context.Context, ...) (*typesadapter.QueryDelegatorUnbondingDelegationsResponse, error) + func (q *Querier) DelegatorValidator(ctx context.Context, request *typesadapter.QueryDelegatorValidatorRequest) (*typesadapter.QueryDelegatorValidatorResponse, error) + func (q *Querier) DelegatorValidators(ctx context.Context, request *typesadapter.QueryDelegatorValidatorsRequest) (*typesadapter.QueryDelegatorValidatorsResponse, error) + func (q *Querier) HistoricalInfo(ctx context.Context, request *typesadapter.QueryHistoricalInfoRequest) (*typesadapter.QueryHistoricalInfoResponse, error) + func (q *Querier) Params(goCtx context.Context, request *typesadapter.QueryParamsRequest) (*typesadapter.QueryParamsResponse, error) + func (q *Querier) Pool(ctx context.Context, request *typesadapter.QueryPoolRequest) (*typesadapter.QueryPoolResponse, error) + func (q *Querier) Redelegations(ctx context.Context, request *typesadapter.QueryRedelegationsRequest) (*typesadapter.QueryRedelegationsResponse, error) + func (q *Querier) UnbondingDelegation(ctx context.Context, request *typesadapter.QueryUnbondingDelegationRequest) (*typesadapter.QueryUnbondingDelegationResponse, error) + func (q *Querier) Validator(ctx context.Context, request *typesadapter.QueryValidatorRequest) (*typesadapter.QueryValidatorResponse, error) + func (q *Querier) ValidatorDelegations(ctx context.Context, request *typesadapter.QueryValidatorDelegationsRequest) (*typesadapter.QueryValidatorDelegationsResponse, error) + func (q *Querier) ValidatorUnbondingDelegations(ctx context.Context, ...) (*typesadapter.QueryValidatorUnbondingDelegationsResponse, error)