keeper

package
v1.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	memKey storetypes.StoreKey,

	authority string,

	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	distrkeeper types.DistrKeeper,
	poolKeeper types.PoolKeeper,
	stakerKeeper types.StakerKeeper,
	delegationKeeper types.DelegationKeeper,
	upgradeKeeper types.UpgradeKeeper,
) *Keeper

func (Keeper) AssertCanPropose

func (k Keeper) AssertCanPropose(ctx sdk.Context, poolId uint64, staker string, proposer string, fromIndex uint64) error

AssertCanPropose checks whether a participant can submit the next bundle proposal in a storage pool

func (Keeper) AssertCanVote

func (k Keeper) AssertCanVote(ctx sdk.Context, poolId uint64, staker string, voter string, storageId string) error

AssertCanVote checks whether a participant in the network can vote on a bundle proposal in a storage pool

func (Keeper) AssertPoolCanRun

func (k Keeper) AssertPoolCanRun(ctx sdk.Context, poolId uint64) error

AssertPoolCanRun checks whether the given pool fulfils all technical/formal requirements to produce bundles

func (Keeper) GetAllBundleProposals

func (k Keeper) GetAllBundleProposals(ctx sdk.Context) (list []types.BundleProposal)

GetAllBundleProposals returns all bundle proposals of all pools

func (Keeper) GetAllFinalizedBundles

func (k Keeper) GetAllFinalizedBundles(ctx sdk.Context) (list []types.FinalizedBundle)

func (Keeper) GetBundleProposal

func (k Keeper) GetBundleProposal(ctx sdk.Context, poolId uint64) (val types.BundleProposal, found bool)

GetBundleProposal returns the bundle proposal for the given pool with id `poolId`

func (Keeper) GetFinalizedBundle

func (k Keeper) GetFinalizedBundle(ctx sdk.Context, poolId, id uint64) (val types.FinalizedBundle, found bool)

GetFinalizedBundle returns a finalized bundle by its identifier

func (Keeper) GetFinalizedBundleByHeight

func (k Keeper) GetFinalizedBundleByHeight(ctx sdk.Context, poolId, height uint64) (val types.FinalizedBundle, found bool)

func (Keeper) GetFinalizedBundlesByPool

func (k Keeper) GetFinalizedBundlesByPool(ctx sdk.Context, poolId uint64) (list []types.FinalizedBundle)

func (Keeper) GetMaxPoints

func (k Keeper) GetMaxPoints(ctx sdk.Context) (res uint64)

GetMaxPoints returns the MaxPoints param

func (Keeper) GetNetworkFee

func (k Keeper) GetNetworkFee(ctx sdk.Context) (res string)

GetNetworkFee returns the NetworkFee param

func (Keeper) GetPaginatedFinalizedBundleQuery

func (k Keeper) GetPaginatedFinalizedBundleQuery(ctx sdk.Context, pagination *query.PageRequest, poolId uint64) ([]types.FinalizedBundle, *query.PageResponse, error)

TODO(postAudit,@max) consider performance improvement

func (Keeper) GetParams

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

GetParams returns the current x/bundles module parameters.

func (Keeper) GetStorageCost

func (k Keeper) GetStorageCost(ctx sdk.Context) (res uint64)

GetStorageCost returns the StorageCost param

func (Keeper) GetUploadTimeout

func (k Keeper) GetUploadTimeout(ctx sdk.Context) (res uint64)

GetUploadTimeout returns the UploadTimeout param

func (Keeper) GetVoteDistribution

func (k Keeper) GetVoteDistribution(ctx sdk.Context, poolId uint64) (voteDistribution types.VoteDistribution)

GetVoteDistribution is an internal function evaluates the quorum status based on the voting power of the current bundle proposal.

func (Keeper) HandleUploadTimeout

func (k Keeper) HandleUploadTimeout(goCtx context.Context)

HandleUploadTimeout is an end block hook that triggers an upload timeout for every pool (if applicable).

func (Keeper) InitMemStore

func (k Keeper) InitMemStore(gasCtx sdk.Context)

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) SetBundleProposal

func (k Keeper) SetBundleProposal(ctx sdk.Context, bundleProposal types.BundleProposal)

SetBundleProposal stores a current bundle proposal in the KV-Store. There is only one bundle proposal per pool

func (Keeper) SetFinalizedBundle

func (k Keeper) SetFinalizedBundle(ctx sdk.Context, finalizedBundle types.FinalizedBundle)

SetFinalizedBundle stores a finalized bundle identified by its `poolId` and `id`.

func (Keeper) SetFinalizedBundleIndexes

func (k Keeper) SetFinalizedBundleIndexes(ctx sdk.Context, finalizedBundle types.FinalizedBundle)

SetFinalizedBundleIndexes sets an in-memory reference for every bundle sorted by pool/fromIndex to allow querying for specific bundle ranges.

func (Keeper) SetParams

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

SetParams sets the x/bundles module parameters.

type RandomChoiceCandidate

type RandomChoiceCandidate struct {
	Account     string
	VotingPower uint64
}

RandomChoiceCandidate holds the voting power of a candidate for the next uploader selection

Jump to

Keyboard shortcuts

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