Documentation ¶
Index ¶
- func GetPurchase(purchaseList types.PurchaseList, purchaseID uint64) (types.Purchase, bool)
- func GlobalStakingPoolInvariant(keeper Keeper) sdk.Invariant
- func ModuleAccountInvariant(keeper Keeper) sdk.Invariant
- func NewQuerier(k Keeper) sdk.Querier
- func ProviderInvariant(keeper Keeper) sdk.Invariant
- func RandomDelegation(r *rand.Rand, k Keeper, ctx sdk.Context) (sdk.AccAddress, sdk.Int, bool)
- func RandomMaturedProposalIDReimbursementPair(r *rand.Rand, k Keeper, ctx sdk.Context) (types.ProposalIDReimbursementPair, bool)
- func RandomPoolInfo(r *rand.Rand, k Keeper, ctx sdk.Context) (uint64, string, bool)
- func RandomProvider(r *rand.Rand, k Keeper, ctx sdk.Context) (types.Provider, bool)
- func RandomPurchaseList(r *rand.Rand, k Keeper, ctx sdk.Context) (types.PurchaseList, bool)
- func RandomValidator(r *rand.Rand, k Keeper, ctx sdk.Context) (staking.Validator, bool)
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func ShieldInvariant(keeper Keeper) sdk.Invariant
- func StakingForShieldPurchaseInvariant(keeper Keeper) sdk.Invariant
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)
- type Keeper
- func (k Keeper) AddPurchase(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, ...) types.PurchaseList
- func (k Keeper) AddRewards(ctx sdk.Context, provider sdk.AccAddress, earnings types.MixedDecCoins)
- func (k Keeper) AddStaking(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchaseID uint64, ...) error
- func (k Keeper) BondDenom(ctx sdk.Context) string
- func (k Keeper) ClaimEnd(ctx sdk.Context, id, poolID uint64, loss sdk.Coins)
- func (k Keeper) ClosePool(ctx sdk.Context, pool types.Pool)
- func (k Keeper) ClosePools(ctx sdk.Context)
- func (k Keeper) ComputeTotalUnbondingAmount(ctx sdk.Context, provider sdk.AccAddress) sdk.Int
- func (k Keeper) ComputeUnbondingAmountByTime(ctx sdk.Context, provider sdk.AccAddress, time time.Time) sdk.Int
- func (k Keeper) ComputeWithdrawAmountByTime(ctx sdk.Context, provider sdk.AccAddress, time time.Time) sdk.Int
- func (k Keeper) CreatePool(ctx sdk.Context, creator sdk.AccAddress, shield sdk.Coins, ...) (uint64, error)
- func (k Keeper) CreateReimbursement(ctx sdk.Context, proposalID uint64, amount sdk.Coins, ...) error
- func (k Keeper) DelayUnbonding(ctx sdk.Context, provider sdk.AccAddress, amount sdk.Int, ...) error
- func (k Keeper) DelayWithdraws(ctx sdk.Context, provider sdk.AccAddress, amount sdk.Int, ...) error
- func (k Keeper) DeleteBlockServiceFees(ctx sdk.Context)
- func (k Keeper) DeletePurchaseList(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) error
- func (k Keeper) DeleteReimbursement(ctx sdk.Context, proposalID uint64) error
- func (k Keeper) DepositCollateral(ctx sdk.Context, from sdk.AccAddress, amount sdk.Int) error
- func (k Keeper) DequeueCompletedWithdrawQueue(ctx sdk.Context)
- func (k Keeper) DequeuePurchase(ctx sdk.Context, purchaseList types.PurchaseList, timestamp time.Time)
- func (k Keeper) ExpiringPurchaseQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) FundShieldBlockRewards(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
- func (k Keeper) GetAdmin(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetAllOriginalStakings(ctx sdk.Context) (originalStakings []types.OriginalStaking)
- func (k Keeper) GetAllPools(ctx sdk.Context) (pools []types.Pool)
- func (k Keeper) GetAllProposalIDReimbursementPairs(ctx sdk.Context) []types.ProposalIDReimbursementPair
- func (k Keeper) GetAllProviders(ctx sdk.Context) (providers []types.Provider)
- func (k Keeper) GetAllPurchaseLists(ctx sdk.Context) (purchases []types.PurchaseList)
- func (k Keeper) GetAllPurchases(ctx sdk.Context) (purchases []types.Purchase)
- func (k Keeper) GetAllReimbursements(ctx sdk.Context) (rmbs []types.Reimbursement)
- func (k Keeper) GetAllStakeForShields(ctx sdk.Context) (purchases []types.ShieldStaking)
- func (k Keeper) GetAllWithdraws(ctx sdk.Context) (withdraws types.Withdraws)
- func (k Keeper) GetBlockServiceFees(ctx sdk.Context) types.MixedDecCoins
- func (k Keeper) GetClaimProposalParams(ctx sdk.Context) types.ClaimProposalParams
- func (k Keeper) GetExpiringPurchaseQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []types.PoolPurchaser
- func (k Keeper) GetGlobalShieldStakingPool(ctx sdk.Context) (pool sdk.Int)
- func (k Keeper) GetLastUpdateTime(ctx sdk.Context) (time.Time, bool)
- func (k Keeper) GetNextPoolID(ctx sdk.Context) uint64
- func (k Keeper) GetNextPurchaseID(ctx sdk.Context) uint64
- func (k Keeper) GetOriginalStaking(ctx sdk.Context, purchaseID uint64) (amount sdk.Int)
- func (k Keeper) GetPool(ctx sdk.Context, id uint64) (types.Pool, bool)
- func (k Keeper) GetPoolBySponsor(ctx sdk.Context, sponsor string) (types.Pool, bool)
- func (k Keeper) GetPoolParams(ctx sdk.Context) types.PoolParams
- func (k Keeper) GetPoolPurchaseLists(ctx sdk.Context, poolID uint64) (purchases []types.PurchaseList)
- func (k Keeper) GetProvider(ctx sdk.Context, delegator sdk.AccAddress) (dt types.Provider, found bool)
- func (k Keeper) GetProvidersIteratorPaginated(ctx sdk.Context, page, limit uint) sdk.Iterator
- func (k Keeper) GetProvidersPaginated(ctx sdk.Context, page, limit uint) (providers []types.Provider)
- func (k Keeper) GetPurchaseList(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) (types.PurchaseList, bool)
- func (k Keeper) GetPurchaserPurchases(ctx sdk.Context, address sdk.AccAddress) (res []types.PurchaseList)
- func (k Keeper) GetReimbursement(ctx sdk.Context, proposalID uint64) (types.Reimbursement, error)
- func (k Keeper) GetRemainingServiceFees(ctx sdk.Context) types.MixedDecCoins
- func (k Keeper) GetRewards(ctx sdk.Context, addr sdk.AccAddress) types.MixedDecCoins
- func (k Keeper) GetServiceFees(ctx sdk.Context) types.MixedDecCoins
- func (k Keeper) GetShieldStakingRate(ctx sdk.Context) (rate sdk.Dec)
- func (k Keeper) GetSortedUnbondingDelegations(ctx sdk.Context, delAddr sdk.AccAddress) []staking.UnbondingDelegation
- func (k Keeper) GetStakeForShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) (purchase types.ShieldStaking, found bool)
- func (k Keeper) GetTotalClaimed(ctx sdk.Context) sdk.Int
- func (k Keeper) GetTotalCollateral(ctx sdk.Context) sdk.Int
- func (k Keeper) GetTotalShield(ctx sdk.Context) sdk.Int
- func (k Keeper) GetTotalWithdrawing(ctx sdk.Context) sdk.Int
- func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (staking.ValidatorI, bool)
- func (k Keeper) GetVotingParams(ctx sdk.Context) govTypes.VotingParams
- func (k Keeper) GetWithdrawQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []types.Withdraw
- func (k Keeper) GetWithdrawsByProvider(ctx sdk.Context, providerAddr sdk.AccAddress) types.Withdraws
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InsertExpiringPurchaseQueue(ctx sdk.Context, purchaseList types.PurchaseList, endTime time.Time)
- func (k Keeper) InsertWithdrawQueue(ctx sdk.Context, withdraw types.Withdraw)
- func (k Keeper) IterateAllPools(ctx sdk.Context, callback func(pool types.Pool) (stop bool))
- func (k Keeper) IterateOriginalStakings(ctx sdk.Context, callback func(original types.OriginalStaking) (stop bool))
- func (k Keeper) IteratePoolPurchaseLists(ctx sdk.Context, poolID uint64, ...)
- func (k Keeper) IterateProviders(ctx sdk.Context, callback func(provider types.Provider) (stop bool))
- func (k Keeper) IterateProvidersPaginated(ctx sdk.Context, page, limit uint, cb func(vote types.Provider) (stop bool))
- func (k Keeper) IteratePurchaseListEntries(ctx sdk.Context, callback func(purchase types.Purchase) (stop bool))
- func (k Keeper) IteratePurchaseLists(ctx sdk.Context, callback func(purchase types.PurchaseList) (stop bool))
- func (k Keeper) IterateReimbursements(ctx sdk.Context, callback func(rmb types.Reimbursement) (stop bool))
- func (k Keeper) IterateStakeForShields(ctx sdk.Context, callback func(purchase types.ShieldStaking) (stop bool))
- func (k Keeper) IterateWithdraws(ctx sdk.Context, callback func(withdraw types.Withdraws) (stop bool))
- func (k Keeper) MakePayoutByProviderDelegations(ctx sdk.Context, providerAddr sdk.AccAddress, purchased, payout sdk.Int) error
- func (k Keeper) PausePool(ctx sdk.Context, updater sdk.AccAddress, id uint64) (types.Pool, error)
- func (k Keeper) PayFromDelegation(ctx sdk.Context, delAddr sdk.AccAddress, payout sdk.Int)
- func (k Keeper) PayFromUnbondings(ctx sdk.Context, ubd staking.UnbondingDelegation, payout sdk.Int)
- func (k Keeper) PayoutNativeRewards(ctx sdk.Context, addr sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) ProcessStakeForShieldExpiration(ctx sdk.Context, poolID, purchaseID uint64, bondDenom string, ...) error
- func (k Keeper) PurchaseShield(ctx sdk.Context, poolID uint64, shield sdk.Coins, description string, ...) (types.Purchase, error)
- func (k Keeper) RemoveDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (k Keeper) RemoveExpiredPurchasesAndDistributeFees(ctx sdk.Context)
- func (k Keeper) RemoveTimeSliceFromWithdrawQueue(ctx sdk.Context, timestamp time.Time)
- func (k Keeper) RestoreShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, id uint64, ...) error
- func (k Keeper) ResumePool(ctx sdk.Context, updater sdk.AccAddress, id uint64) (types.Pool, error)
- func (k Keeper) SecureCollaterals(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchaseID uint64, ...) error
- func (k Keeper) SecureFromProvider(ctx sdk.Context, provider types.Provider, amount sdk.Int, ...)
- func (k Keeper) SetAdmin(ctx sdk.Context, admin sdk.AccAddress)
- func (k Keeper) SetBlockServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
- func (k Keeper) SetClaimProposalParams(ctx sdk.Context, claimProposalParams types.ClaimProposalParams)
- func (k Keeper) SetExpiringPurchaseQueueTimeSlice(ctx sdk.Context, timestamp time.Time, ppPairs []types.PoolPurchaser)
- func (k Keeper) SetGlobalShieldStakingPool(ctx sdk.Context, pool sdk.Int)
- func (k Keeper) SetLastUpdateTime(ctx sdk.Context, prevUpdateTime time.Time)
- func (k Keeper) SetNextPoolID(ctx sdk.Context, id uint64)
- func (k Keeper) SetNextPurchaseID(ctx sdk.Context, id uint64)
- func (k Keeper) SetOriginalStaking(ctx sdk.Context, purchaseID uint64, amount sdk.Int)
- func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)
- func (k Keeper) SetPoolParams(ctx sdk.Context, poolParams types.PoolParams)
- func (k Keeper) SetProvider(ctx sdk.Context, delAddr sdk.AccAddress, provider types.Provider)
- func (k Keeper) SetPurchaseList(ctx sdk.Context, purchaseList types.PurchaseList)
- func (k Keeper) SetReimbursement(ctx sdk.Context, proposalID uint64, payout types.Reimbursement)
- func (k Keeper) SetRemainingServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
- func (k Keeper) SetRewards(ctx sdk.Context, addr sdk.AccAddress, earnings types.MixedDecCoins)
- func (k Keeper) SetServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
- func (k Keeper) SetShieldStakingRate(ctx sdk.Context, rate sdk.Dec)
- func (k Keeper) SetStakeForShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, ...)
- func (k Keeper) SetTotalClaimed(ctx sdk.Context, totalClaimed sdk.Int)
- func (k Keeper) SetTotalCollateral(ctx sdk.Context, totalCollateral sdk.Int)
- func (k Keeper) SetTotalShield(ctx sdk.Context, totalShield sdk.Int)
- func (k Keeper) SetTotalWithdrawing(ctx sdk.Context, totalWithdrawing sdk.Int)
- func (k Keeper) SetWithdrawQueueTimeSlice(ctx sdk.Context, timestamp time.Time, withdraws []types.Withdraw)
- func (k Keeper) UndelegateFromAccountToShieldModule(ctx sdk.Context, senderModule string, delAddr sdk.AccAddress, amt sdk.Coins) error
- func (k Keeper) UndelegateShares(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, ...)
- func (k Keeper) UnstakeFromShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, amount sdk.Int) error
- func (k Keeper) UpdateDelegationAmount(ctx sdk.Context, delAddr sdk.AccAddress)
- func (k Keeper) UpdatePool(ctx sdk.Context, poolID uint64, description string, updater sdk.AccAddress, ...) (types.Pool, error)
- func (k Keeper) UpdateProviderCollateralForPayout(ctx sdk.Context, providerAddr sdk.AccAddress, purchased, payout sdk.Int) error
- func (k Keeper) UpdateSponsor(ctx sdk.Context, poolID uint64, newSponsor string, ...) (types.Pool, error)
- func (k Keeper) WithdrawCollateral(ctx sdk.Context, from sdk.AccAddress, amount sdk.Int) error
- func (k Keeper) WithdrawQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) WithdrawReimbursement(ctx sdk.Context, proposalID uint64, beneficiary sdk.AccAddress) (sdk.Coins, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPurchase ¶
GetPurchase gets a purchase out of a purchase list
func GlobalStakingPoolInvariant ¶ added in v1.1.0
GlobalStakingPoolInvariant checks the total staked sum equals to the global staking pool amount.
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the module account coins reflects the sum of remaining services and rewards held on store
func NewQuerier ¶
NewQuerier creates a querier for shield module.
func ProviderInvariant ¶
ProviderInvariant checks that the providers' coin amounts equal to the tracked value.
func RandomDelegation ¶
RandomDelegation returns a random delegation info given access to the keeper and ctx.
func RandomMaturedProposalIDReimbursementPair ¶ added in v1.1.0
func RandomMaturedProposalIDReimbursementPair(r *rand.Rand, k Keeper, ctx sdk.Context) (types.ProposalIDReimbursementPair, bool)
RandomMaturedProposalIDReimbursementPair returns a random proposal ID - reimbursement pair for a matured reimbursement.
func RandomPoolInfo ¶
RandomPoolInfo returns info of a random pool given access to the keeper and ctx.
func RandomProvider ¶
RandomProvider returns a random provider of collaterals.
func RandomPurchaseList ¶
RandomPurchaseList returns a random purchase given access to the keeper and ctx.
func RandomValidator ¶
RandomValidator returns a random validator given access to the keeper and ctx.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all shield invariants.
func ShieldInvariant ¶
ShieldInvariant checks that the sum of individual pools' shield is equal to the total shield.
func StakingForShieldPurchaseInvariant ¶ added in v1.1.0
SFSPurchaseInvariant checks that sum of original staked shield equals to the total.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, _ sdk.ValAddress)
- when a delegator delegates - when a delegator sends an unbond tx. before the delegation is moved to unbonding queue - when a validator self-delegates to become a validator - when a delegator sends a redelegate tx
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
unused hooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- when a delegator sends an unbond tx that removes a delegation - when a delegator sends a redelegate tx
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper implements the shield keeper.
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, shieldStoreKey sdk.StoreKey, ak types.AccountKeeper, sk types.StakingKeeper, gk types.GovKeeper, supplyKeeper types.SupplyKeeper, paramSpace params.Subspace) Keeper
NewKeeper creates a shield keeper.
func (Keeper) AddPurchase ¶
func (k Keeper) AddPurchase(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchase types.Purchase) types.PurchaseList
AddPurchase sets a purchase of shield.
func (Keeper) AddRewards ¶
func (k Keeper) AddRewards(ctx sdk.Context, provider sdk.AccAddress, earnings types.MixedDecCoins)
AddRewards adds coins to earned rewards.
func (Keeper) AddStaking ¶ added in v1.1.0
func (Keeper) ClaimEnd ¶ added in v1.1.0
ClaimEnd ends a claim process by updating the total claimed amount.
func (Keeper) ClosePools ¶
ClosePools closes pools when both of the pool's shield and shield limit is non-positive.
func (Keeper) ComputeTotalUnbondingAmount ¶ added in v1.1.0
func (Keeper) ComputeUnbondingAmountByTime ¶ added in v1.1.0
func (Keeper) ComputeWithdrawAmountByTime ¶ added in v1.1.0
func (k Keeper) ComputeWithdrawAmountByTime(ctx sdk.Context, provider sdk.AccAddress, time time.Time) sdk.Int
ComputeWithdrawAmountByTime computes the amount of collaterals from a given provider that will be dequeued from the withdraw queue by a given time.
func (Keeper) CreatePool ¶
func (k Keeper) CreatePool(ctx sdk.Context, creator sdk.AccAddress, shield sdk.Coins, serviceFees types.MixedCoins, sponsor string, sponsorAddr sdk.AccAddress, description string, shieldLimit sdk.Int) (uint64, error)
CreatePool creates a pool and sponsor's shield.
func (Keeper) CreateReimbursement ¶ added in v1.1.0
func (k Keeper) CreateReimbursement(ctx sdk.Context, proposalID uint64, amount sdk.Coins, beneficiary sdk.AccAddress) error
CreateReimbursement creates a reimbursement.
func (Keeper) DelayUnbonding ¶ added in v1.1.0
func (Keeper) DelayWithdraws ¶ added in v1.1.0
func (k Keeper) DelayWithdraws(ctx sdk.Context, provider sdk.AccAddress, amount sdk.Int, delayedTime time.Time) error
DelayWithdraws delays the given amount of withdraws maturing before the delay duration until the end of the delay duration.
func (Keeper) DeleteBlockServiceFees ¶ added in v1.1.0
func (Keeper) DeletePurchaseList ¶
DeletePurchaseList deletes a purchase of shield.
func (Keeper) DeleteReimbursement ¶ added in v1.1.0
DeleteReimbursement deletes a reimbursement.
func (Keeper) DepositCollateral ¶
DepositCollateral deposits a community member's collateral for a pool.
func (Keeper) DequeueCompletedWithdrawQueue ¶
DequeueCompletedWithdrawQueue dequeues completed withdraws and processes their completions.
func (Keeper) DequeuePurchase ¶
func (k Keeper) DequeuePurchase(ctx sdk.Context, purchaseList types.PurchaseList, timestamp time.Time)
DequeuePurchase removes a pool-purchaser pair at a given timestamp of the purchase queue.
func (Keeper) ExpiringPurchaseQueueIterator ¶
ExpiringPurchaseQueueIterator returns a iterator of purchases expiring before endTime
func (Keeper) FundShieldBlockRewards ¶ added in v1.1.0
func (Keeper) GetAdmin ¶
func (k Keeper) GetAdmin(ctx sdk.Context) sdk.AccAddress
GetAdmin gets the Shield admin account address.
func (Keeper) GetAllOriginalStakings ¶ added in v1.1.0
func (k Keeper) GetAllOriginalStakings(ctx sdk.Context) (originalStakings []types.OriginalStaking)
func (Keeper) GetAllPools ¶
GetAllPools retrieves all pools in the store.
func (Keeper) GetAllProposalIDReimbursementPairs ¶ added in v1.1.0
func (k Keeper) GetAllProposalIDReimbursementPairs(ctx sdk.Context) []types.ProposalIDReimbursementPair
GetAllProposalIDReimbursementPairs retrieves all proposal ID and reimbursement pairs.
func (Keeper) GetAllProviders ¶
GetAllProviders retrieves all providers.
func (Keeper) GetAllPurchaseLists ¶
func (k Keeper) GetAllPurchaseLists(ctx sdk.Context) (purchases []types.PurchaseList)
GetAllPurchaseLists retrieves all purchase lists.
func (Keeper) GetAllPurchases ¶
GetAllPurchases retrieves all purchases.
func (Keeper) GetAllReimbursements ¶ added in v1.1.0
func (k Keeper) GetAllReimbursements(ctx sdk.Context) (rmbs []types.Reimbursement)
GetAllReimbursements retrieves all reimbursements.
func (Keeper) GetAllStakeForShields ¶ added in v1.1.0
func (k Keeper) GetAllStakeForShields(ctx sdk.Context) (purchases []types.ShieldStaking)
func (Keeper) GetAllWithdraws ¶
GetAllWithdraws gets all collaterals that are being withdrawn.
func (Keeper) GetBlockServiceFees ¶ added in v1.1.0
func (k Keeper) GetBlockServiceFees(ctx sdk.Context) types.MixedDecCoins
func (Keeper) GetClaimProposalParams ¶
func (k Keeper) GetClaimProposalParams(ctx sdk.Context) types.ClaimProposalParams
GetClaimProposalParams returns shield claim proposal parameters.
func (Keeper) GetExpiringPurchaseQueueTimeSlice ¶
func (k Keeper) GetExpiringPurchaseQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []types.PoolPurchaser
GetExpiringPurchaseQueueTimeSlice gets a specific purchase queue timeslice, which is a slice of purchases corresponding to a given time.
func (Keeper) GetGlobalShieldStakingPool ¶ added in v1.1.0
func (Keeper) GetLastUpdateTime ¶
GetLastUpdateTime returns the last update time.
func (Keeper) GetNextPoolID ¶
GetNextPoolID gets the latest pool ID from store.
func (Keeper) GetNextPurchaseID ¶
GetNextPurchaseID gets the latest pool ID from store.
func (Keeper) GetOriginalStaking ¶ added in v1.1.0
func (Keeper) GetPoolBySponsor ¶
GetPoolBySponsor search store for a pool object with given pool ID.
func (Keeper) GetPoolParams ¶
func (k Keeper) GetPoolParams(ctx sdk.Context) types.PoolParams
GetPoolParams returns shield pool parameters.
func (Keeper) GetPoolPurchaseLists ¶
func (k Keeper) GetPoolPurchaseLists(ctx sdk.Context, poolID uint64) (purchases []types.PurchaseList)
GetPoolPurchaseLists returns all purchases in a given pool.
func (Keeper) GetProvider ¶
func (k Keeper) GetProvider(ctx sdk.Context, delegator sdk.AccAddress) (dt types.Provider, found bool)
GetProvider returns data of a provider given its address.
func (Keeper) GetProvidersIteratorPaginated ¶
GetProvidersIteratorPaginated returns an iterator to go over providers based on pagination parameters.
func (Keeper) GetProvidersPaginated ¶
func (k Keeper) GetProvidersPaginated(ctx sdk.Context, page, limit uint) (providers []types.Provider)
GetProvidersPaginated performs paginated query of providers.
func (Keeper) GetPurchaseList ¶
func (k Keeper) GetPurchaseList(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) (types.PurchaseList, bool)
GetPurchaseList gets a purchase from store by txhash.
func (Keeper) GetPurchaserPurchases ¶
func (k Keeper) GetPurchaserPurchases(ctx sdk.Context, address sdk.AccAddress) (res []types.PurchaseList)
GetPurchaserPurchases returns all purchases by a given purchaser.
func (Keeper) GetReimbursement ¶ added in v1.1.0
GetReimbursement get a reimbursement in store.
func (Keeper) GetRemainingServiceFees ¶
func (k Keeper) GetRemainingServiceFees(ctx sdk.Context) types.MixedDecCoins
func (Keeper) GetRewards ¶
func (k Keeper) GetRewards(ctx sdk.Context, addr sdk.AccAddress) types.MixedDecCoins
GetRewards returns total rewards for an address.
func (Keeper) GetServiceFees ¶
func (k Keeper) GetServiceFees(ctx sdk.Context) types.MixedDecCoins
func (Keeper) GetShieldStakingRate ¶ added in v1.1.0
GetShieldStakingRate returns shield to staked rate.
func (Keeper) GetSortedUnbondingDelegations ¶ added in v1.1.0
func (k Keeper) GetSortedUnbondingDelegations(ctx sdk.Context, delAddr sdk.AccAddress) []staking.UnbondingDelegation
GetSortedUnbondingDelegations gets unbonding delegations sorted by completion time from latest to earliest.
func (Keeper) GetStakeForShield ¶ added in v1.1.0
func (k Keeper) GetStakeForShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress) (purchase types.ShieldStaking, found bool)
func (Keeper) GetTotalClaimed ¶ added in v1.1.0
func (Keeper) GetValidator ¶
func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (staking.ValidatorI, bool)
GetValidator returns info of a validator given its operator address.
func (Keeper) GetVotingParams ¶
func (k Keeper) GetVotingParams(ctx sdk.Context) govTypes.VotingParams
GetVotingParams returns gov keeper's voting params.
func (Keeper) GetWithdrawQueueTimeSlice ¶
GetWithdrawQueueTimeSlice gets a specific withdraw queue timeslice, which is a slice of withdraws corresponding to a given time.
func (Keeper) GetWithdrawsByProvider ¶ added in v1.1.0
func (k Keeper) GetWithdrawsByProvider(ctx sdk.Context, providerAddr sdk.AccAddress) types.Withdraws
GetWithdrawsByProvider gets all withdraws of a provider.
func (Keeper) InsertExpiringPurchaseQueue ¶
func (k Keeper) InsertExpiringPurchaseQueue(ctx sdk.Context, purchaseList types.PurchaseList, endTime time.Time)
InsertExpiringPurchaseQueue inserts a purchase into the expired purchase queue.
func (Keeper) InsertWithdrawQueue ¶
InsertWithdrawQueue prepares a withdraw queue timeslice for insertion into the queue.
func (Keeper) IterateAllPools ¶
IterateAllPools iterates over the all the stored pools and performs a callback function.
func (Keeper) IterateOriginalStakings ¶ added in v1.1.0
func (k Keeper) IterateOriginalStakings(ctx sdk.Context, callback func(original types.OriginalStaking) (stop bool))
IterateStakeForShields iterates through purchase lists in a pool
func (Keeper) IteratePoolPurchaseLists ¶
func (k Keeper) IteratePoolPurchaseLists(ctx sdk.Context, poolID uint64, callback func(purchaseList types.PurchaseList) (stop bool))
IteratePoolPurchaseLists iterates through purchases in a pool
func (Keeper) IterateProviders ¶
func (k Keeper) IterateProviders(ctx sdk.Context, callback func(provider types.Provider) (stop bool))
IterateProviders iterates through all providers.
func (Keeper) IterateProvidersPaginated ¶
func (k Keeper) IterateProvidersPaginated(ctx sdk.Context, page, limit uint, cb func(vote types.Provider) (stop bool))
IterateProvidersPaginated iterates over providers based on pagination parameters and performs a callback function.
func (Keeper) IteratePurchaseListEntries ¶
func (k Keeper) IteratePurchaseListEntries(ctx sdk.Context, callback func(purchase types.Purchase) (stop bool))
IteratePurchaseListEntries iterates through entries of all purchase lists.
func (Keeper) IteratePurchaseLists ¶
func (k Keeper) IteratePurchaseLists(ctx sdk.Context, callback func(purchase types.PurchaseList) (stop bool))
IteratePurchaseLists iterates through purchase lists in a pool
func (Keeper) IterateReimbursements ¶ added in v1.1.0
func (k Keeper) IterateReimbursements(ctx sdk.Context, callback func(rmb types.Reimbursement) (stop bool))
IterateReimbursements iterates through all reimbursements.
func (Keeper) IterateStakeForShields ¶ added in v1.1.0
func (k Keeper) IterateStakeForShields(ctx sdk.Context, callback func(purchase types.ShieldStaking) (stop bool))
IterateStakeForShields iterates through purchase lists in a pool
func (Keeper) IterateWithdraws ¶
func (k Keeper) IterateWithdraws(ctx sdk.Context, callback func(withdraw types.Withdraws) (stop bool))
IterateWithdraws iterates through all ongoing withdraws.
func (Keeper) MakePayoutByProviderDelegations ¶ added in v1.1.0
func (k Keeper) MakePayoutByProviderDelegations(ctx sdk.Context, providerAddr sdk.AccAddress, purchased, payout sdk.Int) error
MakePayoutByProviderDelegations undelegates the provider's delegations and transfers tokens from the staking module account to the shield module account.
func (Keeper) PayFromDelegation ¶ added in v1.1.0
PayFromDelegation reduce provider's delegations and transfer tokens to the shield module account.
func (Keeper) PayFromUnbondings ¶ added in v1.1.0
PayFromUnbondings reduce provider's unbonding delegations and transfer tokens to the shield module account.
func (Keeper) PayoutNativeRewards ¶
PayoutNativeRewards pays out pending CTK rewards.
func (Keeper) ProcessStakeForShieldExpiration ¶ added in v1.1.0
func (Keeper) PurchaseShield ¶
func (k Keeper) PurchaseShield(ctx sdk.Context, poolID uint64, shield sdk.Coins, description string, purchaser sdk.AccAddress, staking bool) (types.Purchase, error)
PurchaseShield purchases shield of a pool with standard fee rate.
func (Keeper) RemoveDelegation ¶
func (k Keeper) RemoveDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
RemoveDelegation updates the provider when its delegation is removed.
func (Keeper) RemoveExpiredPurchasesAndDistributeFees ¶
RemoveExpiredPurchasesAndDistributeFees removes expired purchases and distributes fees for current block.
func (Keeper) RemoveTimeSliceFromWithdrawQueue ¶ added in v1.1.0
RemoveTimeSliceFromWithdrawQueue removes a time slice from the withdraw queue.
func (Keeper) RestoreShield ¶
func (k Keeper) RestoreShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, id uint64, loss sdk.Coins) error
RestoreShield restores shield-related states as they were prior to the claim proposal submission.
func (Keeper) ResumePool ¶
ResumePool sets an inactive pool to be active.
func (Keeper) SecureCollaterals ¶ added in v1.1.0
func (k Keeper) SecureCollaterals(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchaseID uint64, loss sdk.Coins, duration time.Duration) error
SecureCollaterals is called after a claim is submitted to secure the given amount of collaterals for the duration and adjust shield module states accordingly.
func (Keeper) SecureFromProvider ¶ added in v1.1.0
func (k Keeper) SecureFromProvider(ctx sdk.Context, provider types.Provider, amount sdk.Int, duration time.Duration)
SecureFromProvider secures the specified amount of collaterals from the provider for the duration. If necessary, it extends withdrawing collaterals and, if exist, their linked unbondings as well.
func (Keeper) SetAdmin ¶
func (k Keeper) SetAdmin(ctx sdk.Context, admin sdk.AccAddress)
SetAdmin sets the Shield admin account address.
func (Keeper) SetBlockServiceFees ¶ added in v1.1.0
func (k Keeper) SetBlockServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
func (Keeper) SetClaimProposalParams ¶
func (k Keeper) SetClaimProposalParams(ctx sdk.Context, claimProposalParams types.ClaimProposalParams)
SetClaimProposalParams sets parameters subspace for shield claim proposal parameters.
func (Keeper) SetExpiringPurchaseQueueTimeSlice ¶
func (k Keeper) SetExpiringPurchaseQueueTimeSlice(ctx sdk.Context, timestamp time.Time, ppPairs []types.PoolPurchaser)
SetExpiringPurchaseQueueTimeSlice sets a time slice for a purchase expiring at give time.
func (Keeper) SetGlobalShieldStakingPool ¶ added in v1.1.0
func (Keeper) SetLastUpdateTime ¶
SetLastUpdateTime sets the last update time. Last update time will be set when the first purchase is made or distributing service fees.
func (Keeper) SetNextPoolID ¶
SetLatestPoolID sets the latest pool ID to store.
func (Keeper) SetNextPurchaseID ¶
SetNextPurchaseID sets the latest pool ID to store.
func (Keeper) SetOriginalStaking ¶ added in v1.1.0
func (Keeper) SetPoolParams ¶
func (k Keeper) SetPoolParams(ctx sdk.Context, poolParams types.PoolParams)
SetPoolParams sets parameters subspace for shield pool parameters.
func (Keeper) SetProvider ¶
SetProvider sets data of a provider in the kv-store.
func (Keeper) SetPurchaseList ¶
func (k Keeper) SetPurchaseList(ctx sdk.Context, purchaseList types.PurchaseList)
SetPurchaseList sets a purchase list.
func (Keeper) SetReimbursement ¶ added in v1.1.0
SetReimbursement sets a reimbursement in store.
func (Keeper) SetRemainingServiceFees ¶
func (k Keeper) SetRemainingServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
func (Keeper) SetRewards ¶
func (k Keeper) SetRewards(ctx sdk.Context, addr sdk.AccAddress, earnings types.MixedDecCoins)
SetRewards sets the rewards for an address.
func (Keeper) SetServiceFees ¶
func (k Keeper) SetServiceFees(ctx sdk.Context, serviceFees types.MixedDecCoins)
func (Keeper) SetShieldStakingRate ¶ added in v1.1.0
SetShieldStakingRate sets shield to staked rate.
func (Keeper) SetStakeForShield ¶ added in v1.1.0
func (k Keeper) SetStakeForShield(ctx sdk.Context, poolID uint64, purchaser sdk.AccAddress, purchase types.ShieldStaking)
func (Keeper) SetTotalClaimed ¶ added in v1.1.0
func (Keeper) SetTotalCollateral ¶
func (Keeper) SetTotalWithdrawing ¶
func (Keeper) SetWithdrawQueueTimeSlice ¶
func (k Keeper) SetWithdrawQueueTimeSlice(ctx sdk.Context, timestamp time.Time, withdraws []types.Withdraw)
SetWithdrawQueueTimeSlice stores a withdraw queue timeslice using the timestamp as the key.
func (Keeper) UndelegateFromAccountToShieldModule ¶ added in v1.1.0
func (k Keeper) UndelegateFromAccountToShieldModule(ctx sdk.Context, senderModule string, delAddr sdk.AccAddress, amt sdk.Coins) error
UndelegateFromAccountToShieldModule performs undelegations from a delegator's staking to the shield module.
func (Keeper) UndelegateShares ¶ added in v1.1.0
func (k Keeper) UndelegateShares(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares sdk.Dec)
UndelegateShares undelegates delegations of a delegator to a validator by shares.
func (Keeper) UnstakeFromShield ¶ added in v1.1.0
func (Keeper) UpdateDelegationAmount ¶
func (k Keeper) UpdateDelegationAmount(ctx sdk.Context, delAddr sdk.AccAddress)
UpdateDelegationAmount updates the provider based on tha changes of its delegations.
func (Keeper) UpdatePool ¶
func (k Keeper) UpdatePool(ctx sdk.Context, poolID uint64, description string, updater sdk.AccAddress, shield sdk.Coins, serviceFees types.MixedCoins, shieldLimit sdk.Int) (types.Pool, error)
UpdatePool updates pool info and shield for B.
func (Keeper) UpdateProviderCollateralForPayout ¶ added in v1.1.0
func (k Keeper) UpdateProviderCollateralForPayout(ctx sdk.Context, providerAddr sdk.AccAddress, purchased, payout sdk.Int) error
UpdateProviderCollateralForPayout updates a provider's collateral and withdraws according to the payout.
func (Keeper) UpdateSponsor ¶ added in v1.1.0
func (k Keeper) UpdateSponsor(ctx sdk.Context, poolID uint64, newSponsor string, newSponsorAddr, updater sdk.AccAddress) (types.Pool, error)
UpdateSponsor updates the sponsor information of a given pool.
func (Keeper) WithdrawCollateral ¶
WithdrawCollateral withdraws a community member's collateral for a pool. In case of unbonding-initiated withdraw, store the validator address and the creation height.
func (Keeper) WithdrawQueueIterator ¶
WithdrawQueueIterator returns all the withdraw queue timeslices from time 0 until endTime.