keeper

package
v0.0.0-...-aba098d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TODO_BLOCKER/TODO_UPNEXT(@Olshansk): Implement this properly. Using a constant
	// for "probabilistic proofs" is just a simple placeholder mechanism to get
	// #359 over the finish line.
	ProofRequiredComputeUnits = 100
)

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,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,

	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	applicationKeeper types.ApplicationKeeper,
	proofKeeper types.ProofKeeper,
) Keeper

func (Keeper) ComputeUnitsToTokensMultiplier

func (k Keeper) ComputeUnitsToTokensMultiplier(ctx context.Context) uint64

ComputeUnitsToTokensMultiplier returns the ComputeUnitsToTokensMultiplier param

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/tokenomics module's authority.

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SettlePendingClaims

func (k Keeper) SettlePendingClaims(ctx sdk.Context) (numClaimsSettled, numClaimsExpired uint64, err error)

SettlePendingClaims settles all pending (i.e. expiring) claims. If a claim is expired and requires a proof and a proof IS available -> it's settled. If a claim is expired and requires a proof and a proof IS NOT available -> it's deleted. If a claim is expired and does NOT require a proof -> it's settled. Events are emitted for each claim that is settled or removed. On-chain Claims & Proofs are deleted after they're settled or expired to free up space.

func (Keeper) SettleSessionAccounting

func (k Keeper) SettleSessionAccounting(
	ctx context.Context,
	claim *prooftypes.Claim,
) error

SettleSessionAccounting is responsible for all of the post-session accounting necessary to burn, mint or transfer tokens depending on the amount of work done. The amount of "work done" complete is dictated by `sum` of `root`.

ASSUMPTION: It is assumed the caller of this function validated the claim against a proof BEFORE calling this function.

TODO_BLOCKER(@Olshansk): Is there a way to limit who can call this function?

Jump to

Keyboard shortcuts

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