basket

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func BasketSupplyInvariant

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

BasketSupplyInvariant cross check the balance of baskets and bank

func GogoPageReqToPulsarPageReq

func GogoPageReqToPulsarPageReq(from *query.PageRequest) (*queryv1beta1.PageRequest, error)

func GogoToPulsarSlow

func GogoToPulsarSlow(from gogoproto.Message, to proto.Message) error

func PulsarPageResToGogoPageRes

func PulsarPageResToGogoPageRes(from *queryv1beta1.PageResponse) (*query.PageResponse, error)

func PulsarToGogoSlow

func PulsarToGogoSlow(from proto.Message, to gogoproto.Message) error

Types

type EcocreditKeeper

type EcocreditKeeper interface {
	// we embed a query server directly here rather than trying to go through
	// ADR 033 for simplicity
	ecocredit.QueryServer

	GetCreateBasketFee(ctx context.Context) sdk.Coins
	HasClassInfo(ctx types.Context, classID string) bool
}

EcocreditKeeper abstracts over methods that the main ecocredit keeper needs to expose to the basket keeper.

NOTE: run `make mocks` whenever you add methods here

type Keeper

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

Keeper is the basket keeper.

func NewKeeper

func NewKeeper(
	db ormdb.ModuleDB,
	ecocreditKeeper EcocreditKeeper,
	bankKeeper ecocredit.BankKeeper,
	distKeeper ecocredit.DistributionKeeper,
	storeKey sdk.StoreKey,
) Keeper

NewKeeper returns a new keeper instance.

func (Keeper) Create

Create is an RPC to handle basket.MsgCreate

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

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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