keeper

package
v0.0.0-...-1d4aedf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyEpoch = 0
	FirstEpoch = 1
)

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 Base

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

func (*Base) DeleteDepositedAmountByUser

func (b *Base) DeleteDepositedAmountByUser(ctx sdk.Context, veID uint64)

func (*Base) DeleteUserVeIDByAddress

func (b *Base) DeleteUserVeIDByAddress(ctx sdk.Context, acc sdk.AccAddress)

func (*Base) EscrowPool

func (b *Base) EscrowPool(ctx sdk.Context) authtypes.AccountI

func (*Base) GetCheckpoint

func (b *Base) GetCheckpoint(ctx sdk.Context, epoch uint64) types.Checkpoint

func (*Base) GetDepositedAmountByUser

func (b *Base) GetDepositedAmountByUser(ctx sdk.Context, veID uint64) sdk.Int

func (*Base) GetDerivedAmountByUser

func (b *Base) GetDerivedAmountByUser(ctx sdk.Context, veID uint64) sdk.Int

func (*Base) GetEpoch

func (b *Base) GetEpoch(ctx sdk.Context) uint64

func (*Base) GetReward

func (b *Base) GetReward(ctx sdk.Context, rewardDenom string) types.Reward

func (*Base) GetRewardCheckpoint

func (b *Base) GetRewardCheckpoint(ctx sdk.Context, rewardDenom string, epoch uint64) types.Checkpoint

func (*Base) GetRewardEpoch

func (b *Base) GetRewardEpoch(ctx sdk.Context, rewardDenom string) uint64

func (*Base) GetTotalDepositedAmount

func (b *Base) GetTotalDepositedAmount(ctx sdk.Context) sdk.Int

func (*Base) GetTotalDerivedAmount

func (b *Base) GetTotalDerivedAmount(ctx sdk.Context) sdk.Int

func (*Base) GetUserCheckpoint

func (b *Base) GetUserCheckpoint(ctx sdk.Context, veID uint64, epoch uint64) types.Checkpoint

func (*Base) GetUserEpoch

func (b *Base) GetUserEpoch(ctx sdk.Context, veID uint64) uint64

func (*Base) GetUserReward

func (b *Base) GetUserReward(ctx sdk.Context, rewardDenom string, veID uint64) types.UserReward

func (*Base) GetUserVeIDByAddress

func (b *Base) GetUserVeIDByAddress(ctx sdk.Context, acc sdk.AccAddress) uint64

func (*Base) IterateRewards

func (b *Base) IterateRewards(ctx sdk.Context, handler func(reward types.Reward) (stop bool))

func (*Base) PoolDenom

func (b *Base) PoolDenom() string

func (*Base) PoolName

func (b *Base) PoolName() string

func (*Base) RemainingReward

func (b *Base) RemainingReward(ctx sdk.Context, rewardDenom string) sdk.Int

func (*Base) SetCheckpoint

func (b *Base) SetCheckpoint(ctx sdk.Context, epoch uint64, point types.Checkpoint)

func (*Base) SetDepositedAmountByUser

func (b *Base) SetDepositedAmountByUser(ctx sdk.Context, veID uint64, amount sdk.Int)

func (*Base) SetDerivedAmountByUser

func (b *Base) SetDerivedAmountByUser(ctx sdk.Context, veID uint64, amount sdk.Int)

func (*Base) SetEpoch

func (b *Base) SetEpoch(ctx sdk.Context, epoch uint64)

func (*Base) SetReward

func (b *Base) SetReward(ctx sdk.Context, rewardDenom string, reward types.Reward)

func (*Base) SetRewardCheckpoint

func (b *Base) SetRewardCheckpoint(ctx sdk.Context, rewardDenom string, epoch uint64, point types.Checkpoint)

func (*Base) SetRewardEpoch

func (b *Base) SetRewardEpoch(ctx sdk.Context, rewardDenom string, epoch uint64)

func (*Base) SetTotalDepositedAmount

func (b *Base) SetTotalDepositedAmount(ctx sdk.Context, amount sdk.Int)

func (*Base) SetTotalDerivedAmount

func (b *Base) SetTotalDerivedAmount(ctx sdk.Context, amount sdk.Int)

func (*Base) SetUserCheckpoint

func (b *Base) SetUserCheckpoint(ctx sdk.Context, veID uint64, epoch uint64, point types.Checkpoint)

func (*Base) SetUserEpoch

func (b *Base) SetUserEpoch(ctx sdk.Context, veID uint64, epoch uint64)

func (*Base) SetUserReward

func (b *Base) SetUserReward(ctx sdk.Context, rewardDenom string, veID uint64, reward types.UserReward)

func (*Base) SetUserVeIDByAddress

func (b *Base) SetUserVeIDByAddress(ctx sdk.Context, acc sdk.AccAddress, veID uint64)

type Bribe

type Bribe struct {
	Base
}

func (Bribe) ClaimReward

func (b Bribe) ClaimReward(ctx sdk.Context, veID uint64) (err error)

func (Bribe) Deposit

func (b Bribe) Deposit(ctx sdk.Context, veID uint64, amount sdk.Int)

func (Bribe) Withdraw

func (b Bribe) Withdraw(ctx sdk.Context, veID uint64, amount sdk.Int) (err error)

type FeeClaimee

type FeeClaimee interface {
	ClaimFees(ctx sdk.Context, claimant sdk.AccAddress) sdk.Coins
}

type Gauge

type Gauge struct {
	Base
	// contains filtered or unexported fields
}

func (Gauge) ClaimReward

func (g Gauge) ClaimReward(ctx sdk.Context, veID uint64, voterKeeper types.VoterKeeper) (err error)

func (Gauge) Deposit

func (g Gauge) Deposit(ctx sdk.Context, veID uint64, amount sdk.Int) (err error)

func (Gauge) DepositFees

func (g Gauge) DepositFees(ctx sdk.Context, feeClaimee FeeClaimee) (err error)

func (Gauge) DepositReward

func (g Gauge) DepositReward(ctx sdk.Context, sender sdk.AccAddress, rewardDenom string, amount sdk.Int) error

func (Gauge) Withdraw

func (g Gauge) Withdraw(ctx sdk.Context, veID uint64, amount sdk.Int) (err error)

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	nftKeeper types.NftKeeper,
	veKeeper types.VeKeeper,
) *Keeper

func (Keeper) Bribe

func (k Keeper) Bribe(ctx sdk.Context, depoistDenom string) Bribe

func (Keeper) CreateGauge

func (k Keeper) CreateGauge(ctx sdk.Context, depoistDenom string)

func (Keeper) Gauge

func (k Keeper) Gauge(ctx sdk.Context, depoistDenom string) Gauge

func (Keeper) GetGauges

func (k Keeper) GetGauges(ctx sdk.Context) (denoms []string)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) HasGauge

func (k Keeper) HasGauge(ctx sdk.Context, depositDenom string) bool

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) SetGauge

func (k Keeper) SetGauge(ctx sdk.Context, depositDenom string)

func (Keeper) SetParams

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

SetParams set the params

Jump to

Keyboard shortcuts

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