keeper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDecreasingFactor added in v0.0.8

func CalculateDecreasingFactor(coinInfo types.Coin, amountInCollector sdkmath.Int, amountToBurn sdkmath.Int) sdk.Dec

Helper function for slashing in validator module CalculateDecreasingFactor checks future parameters for coin burn

func EndBlocker added in v0.1.0

func EndBlocker(ctx sdk.Context, k Keeper, req abci.RequestEndBlock) []abci.ValidatorUpdate

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.

func NewKeeper

NewKeeper creates new Keeper instance.

func (Keeper) BurnCoin added in v0.0.8

func (k Keeper) BurnCoin(goCtx context.Context, msg *types.MsgBurnCoin) (*types.MsgBurnCoinResponse, error)

func (*Keeper) BurnPoolCoins added in v0.0.8

func (k *Keeper) BurnPoolCoins(ctx sdk.Context, poolName string, coins sdk.Coins) error

Special burn mainly for slashing in validator module It decrease both volume and reserve pool must be exists and must have burning right

func (Keeper) BuyCoin

func (k Keeper) BuyCoin(goCtx context.Context, msg *types.MsgBuyCoin) (*types.MsgBuyCoinResponse, error)

func (Keeper) Check

func (*Keeper) CheckFutureChanges

func (k *Keeper) CheckFutureChanges(ctx sdk.Context, coinInfo types.Coin, amount sdkmath.Int) error

Check than buy/sell/fee deduct operations will not violate coin constants: minimal volume, limit volume, minimal reserve It includes check balance of auth.FeeCollectorName Positive amount = buy = increase volume and reserve Negative amount = sell/deduct = decrease volume and reserve

func (*Keeper) CheckFutureVolumeChanges added in v0.0.8

func (k *Keeper) CheckFutureVolumeChanges(ctx sdk.Context, coinInfo types.Coin, amount sdkmath.Int) error

same as above, but check only volume need for burn operation, because this doest not change reserve

func (Keeper) Checks

func (Keeper) Coin

func (Keeper) Coins

func (Keeper) CreateCoin

func (k Keeper) CreateCoin(goCtx context.Context, msg *types.MsgCreateCoin) (*types.MsgCreateCoinResponse, error)

func (*Keeper) GetBaseDenom

func (k *Keeper) GetBaseDenom(ctx sdk.Context) string

GetBaseDenom returns base coin denomination.

func (*Keeper) GetCheck

func (k *Keeper) GetCheck(ctx sdk.Context, checkHash []byte) (check types.Check, err error)

GetCheck returns the redeemed check if exists in KVStore.

func (*Keeper) GetChecks

func (k *Keeper) GetChecks(ctx sdk.Context) (checks []types.Check)

GetChecks returns all checks existing in KVStore.

func (*Keeper) GetCoin

func (k *Keeper) GetCoin(ctx sdk.Context, denom string) (coin types.Coin, err error)

GetCoin returns the coin if exists in KVStore.

func (*Keeper) GetCoins

func (k *Keeper) GetCoins(ctx sdk.Context) (coins []types.Coin)

GetCoins returns all coins existing in KVStore.

func (*Keeper) GetCommission

func (k *Keeper) GetCommission(ctx sdk.Context, feeAmountBase sdkmath.Int) (feeAmount sdkmath.Int, denom string, err error)

func (*Keeper) GetDecreasingFactor added in v0.0.8

func (k *Keeper) GetDecreasingFactor(ctx sdk.Context, coin sdk.Coin) (sdk.Dec, error)

func (*Keeper) GetParams

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

GetParams returns the total set of the module parameters.

func (*Keeper) IsCheckRedeemed

func (k *Keeper) IsCheckRedeemed(ctx sdk.Context, check *types.Check) bool

IsCheckRedeemed returns true if provided check is marked as redeemed in KVStore.

func (*Keeper) IsCoinBase

func (k *Keeper) IsCoinBase(ctx sdk.Context, denom string) bool

IsCoinBase returns true if specified denom is base icon.

func (*Keeper) IsCoinExists added in v0.0.8

func (k *Keeper) IsCoinExists(ctx sdk.Context, denom string) bool

GetCoin returns the coin if exists in KVStore.

func (*Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MultiSendCoin

func (Keeper) Params

func (Keeper) RedeemCheck

func (Keeper) SellAllCoin

func (Keeper) SellCoin

func (k Keeper) SellCoin(goCtx context.Context, msg *types.MsgSellCoin) (*types.MsgSellCoinResponse, error)

func (Keeper) SendCoin

func (k Keeper) SendCoin(goCtx context.Context, msg *types.MsgSendCoin) (*types.MsgSendCoinResponse, error)

SendCoin creates new custom coin.

func (*Keeper) SetCheck

func (k *Keeper) SetCheck(ctx sdk.Context, check *types.Check)

SetCheck writes check to KVStore.

func (*Keeper) SetCoin

func (k *Keeper) SetCoin(ctx sdk.Context, coin types.Coin)

SetCoin writes coin to KVStore.

func (*Keeper) SetParams

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

SetParams sets the module parameters to the param space.

func (Keeper) UpdateCoin

func (k Keeper) UpdateCoin(goCtx context.Context, msg *types.MsgUpdateCoin) (*types.MsgUpdateCoinResponse, error)

func (*Keeper) UpdateCoinVR added in v0.0.8

func (k *Keeper) UpdateCoinVR(ctx sdk.Context, denom string, volume sdkmath.Int, reserve sdkmath.Int) error

UpdateCoinVR updates current coin reserve and volume and writes coin to KVStore.

Jump to

Keyboard shortcuts

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