Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func ParamKeyTable() paramstypes.KeyTable
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- func RewardInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AdjustPool(ctx sdk.Context, poolName string, reward sdk.Coins, rewardPerBlock sdk.Coins, ...) (err error)
- func (k Keeper) CreatePool(ctx sdk.Context, name string, description string, lpTokenDenom string, ...) error
- func (k Keeper) CreatePoolFee(ctx sdk.Context) (fee sdk.Coin)
- func (k Keeper) DeleteFarmInfo(ctx sdk.Context, poolName, address string)
- func (k Keeper) DequeueActivePool(ctx sdk.Context, poolName string, expiredHeight int64)
- func (k Keeper) DestroyPool(ctx sdk.Context, poolName string, creator sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) EnqueueActivePool(ctx sdk.Context, poolName string, expiredHeight int64)
- func (k Keeper) Expired(ctx sdk.Context, pool types.FarmPool) bool
- func (k Keeper) FarmPool(goctx context.Context, request *types.QueryFarmPoolRequest) (*types.QueryFarmPoolResponse, error)
- func (k Keeper) FarmPools(goctx context.Context, request *types.QueryFarmPoolsRequest) (*types.QueryFarmPoolsResponse, error)
- func (k Keeper) Farmer(goctx context.Context, request *types.QueryFarmerRequest) (*types.QueryFarmerResponse, error)
- func (k Keeper) GetFarmInfo(ctx sdk.Context, poolName, address string) (info types.FarmInfo, exist bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPool(ctx sdk.Context, poolName string) (types.FarmPool, bool)
- func (k Keeper) GetRewardRules(ctx sdk.Context, poolName string) (rules types.RewardRules)
- func (k Keeper) Harvest(ctx sdk.Context, poolName string, sender sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) IteratorActivePool(ctx sdk.Context, fun func(pool types.FarmPool))
- func (k Keeper) IteratorAllFarmInfo(ctx sdk.Context, fun func(farmer types.FarmInfo))
- func (k Keeper) IteratorAllPools(ctx sdk.Context, fun func(pool types.FarmPool))
- func (k Keeper) IteratorExpiredPool(ctx sdk.Context, height int64, fun func(pool types.FarmPool))
- func (k Keeper) IteratorFarmInfo(ctx sdk.Context, address string, fun func(farmer types.FarmInfo))
- func (k Keeper) IteratorRewardRules(ctx sdk.Context, poolName string, fun func(r types.RewardRule))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxRewardCategories(ctx sdk.Context) (maxRewardCategories uint32)
- func (k Keeper) Params(goctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Refund(ctx sdk.Context, pool types.FarmPool) (sdk.Coins, error)
- func (k Keeper) SetFarmInfo(ctx sdk.Context, farmer types.FarmInfo)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) (fee sdk.Coin)
- func (k Keeper) SetPool(ctx sdk.Context, pool types.FarmPool)
- func (k Keeper) SetRewardRule(ctx sdk.Context, poolName string, rule types.RewardRule)
- func (k Keeper) SetRewardRules(ctx sdk.Context, poolName string, rules types.RewardRules)
- func (k Keeper) Stake(ctx sdk.Context, poolName string, lpToken sdk.Coin, sender sdk.AccAddress) (reward sdk.Coins, err error)
- func (k Keeper) Unstake(ctx sdk.Context, poolName string, lpToken sdk.Coin, sender sdk.AccAddress) (_ sdk.Coins, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the farm module.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the farm MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all invariants
func RewardInvariant ¶
RewardInvariant checks whether the amount of module account is consistent with the recorded in the farm
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the farm store
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey sdk.StoreKey, bk types.BankKeeper, ak types.AccountKeeper, validateLPToken types.ValidateLPToken, paramSpace paramstypes.Subspace, feeCollectorName string, ) Keeper
func (Keeper) AdjustPool ¶
func (k Keeper) AdjustPool( ctx sdk.Context, poolName string, reward sdk.Coins, rewardPerBlock sdk.Coins, creator sdk.AccAddress, ) (err error)
AdjustPool adjusts farm pool parameters
func (Keeper) CreatePool ¶
func (k Keeper) CreatePool( ctx sdk.Context, name string, description string, lpTokenDenom string, startHeight int64, rewardPerBlock sdk.Coins, totalReward sdk.Coins, editable bool, creator sdk.AccAddress, ) error
CreatePool creates an new farm pool
func (Keeper) CreatePoolFee ¶
CreatePoolFee returns the create pool fee
func (Keeper) DeleteFarmInfo ¶
func (Keeper) DequeueActivePool ¶
func (Keeper) DestroyPool ¶
func (k Keeper) DestroyPool(ctx sdk.Context, poolName string, creator sdk.AccAddress) (sdk.Coins, error)
Destroy destroy an exist farm pool
func (Keeper) EnqueueActivePool ¶
func (Keeper) FarmPool ¶
func (k Keeper) FarmPool(goctx context.Context, request *types.QueryFarmPoolRequest) (*types.QueryFarmPoolResponse, error)
func (Keeper) FarmPools ¶
func (k Keeper) FarmPools(goctx context.Context, request *types.QueryFarmPoolsRequest) (*types.QueryFarmPoolsResponse, error)
func (Keeper) Farmer ¶
func (k Keeper) Farmer(goctx context.Context, request *types.QueryFarmerRequest) (*types.QueryFarmerResponse, error)
func (Keeper) GetFarmInfo ¶
func (k Keeper) GetFarmInfo(ctx sdk.Context, poolName, address string) (info types.FarmInfo, exist bool)
GetFarmer return the specified farmer
func (Keeper) GetRewardRules ¶
func (Keeper) IteratorActivePool ¶
func (Keeper) IteratorAllFarmInfo ¶
func (Keeper) IteratorAllPools ¶
func (Keeper) IteratorExpiredPool ¶
func (Keeper) IteratorFarmInfo ¶
func (Keeper) IteratorRewardRules ¶
func (Keeper) MaxRewardCategories ¶
MaxRewardCategories returns the maxRewardCategories
func (Keeper) Params ¶
func (k Keeper) Params(goctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) SetFarmInfo ¶
SetFarmer save the farmer information
func (Keeper) SetRewardRule ¶
func (Keeper) SetRewardRules ¶
Click to show internal directories.
Click to hide internal directories.