basket

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCantDisableRetire = sdkerrors.Register(codespace, 2, "can't disable retirement when taking from this basket")
)

Functions

func BasketSupplyInvariant

func BasketSupplyInvariant(ctx sdk.Context, store api.BasketTable, bank bankSupplyStore, basketBalances map[uint64]math.Dec) (string, bool)

BasketSupplyInvariant cross check the balance of baskets and bank

Types

type Keeper

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

Keeper is the basket keeper.

func NewKeeper

func NewKeeper(
	ss api.StateStore,
	cs ecoApi.StateStore,
	bk ecocredit.BankKeeper,
	pk ecocredit.ParamKeeper,
	ma sdk.AccAddress,
) Keeper

NewKeeper returns a new keeper instance.

func (Keeper) Create

Create is an RPC to handle basket.MsgCreate

func (Keeper) GetBasketBalanceMap

func (k Keeper) GetBasketBalanceMap(ctx context.Context) (map[uint64]math.Dec, error)

GetBasketBalanceMap calculates credit balance of each batch within the basket

func (Keeper) Put

Put deposits ecocredits into a basket, returning fungible coins to the depositor. NOTE: the credits MUST adhere to the following specifications set by the basket: credit type, class, and date criteria.

func (Keeper) RegisterInvariants

func (k Keeper) RegisterInvariants(ir sdk.InvariantRegistry)

func (Keeper) Take

Jump to

Keyboard shortcuts

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