Documentation ¶
Index ¶
- Variables
- func BasketSupplyInvariant(ctx sdk.Context, store basketv1.BasketStore, bank bankSupplyStore, ...) (string, bool)
- func GogoPageReqToPulsarPageReq(from *query.PageRequest) (*queryv1beta1.PageRequest, error)
- func GogoToPulsarSlow(from gogoproto.Message, to proto.Message) error
- func PulsarPageResToGogoPageRes(from *queryv1beta1.PageResponse) (*query.PageResponse, error)
- func PulsarToGogoSlow(from proto.Message, to gogoproto.Message) error
- type EcocreditKeeper
- type Keeper
- func (k Keeper) Basket(ctx context.Context, request *baskettypes.QueryBasketRequest) (*baskettypes.QueryBasketResponse, error)
- func (k Keeper) BasketBalance(ctx context.Context, request *baskettypes.QueryBasketBalanceRequest) (*baskettypes.QueryBasketBalanceResponse, error)
- func (k Keeper) BasketBalances(ctx context.Context, request *baskettypes.QueryBasketBalancesRequest) (*baskettypes.QueryBasketBalancesResponse, error)
- func (k Keeper) Baskets(ctx context.Context, request *baskettypes.QueryBasketsRequest) (*baskettypes.QueryBasketsResponse, error)
- func (k Keeper) Create(ctx context.Context, msg *basket.MsgCreate) (*basket.MsgCreateResponse, error)
- func (k Keeper) Put(ctx context.Context, req *baskettypes.MsgPut) (*baskettypes.MsgPutResponse, error)
- func (k Keeper) RegisterInvariants(ir sdk.InvariantRegistry)
- func (k Keeper) Take(ctx context.Context, msg *baskettypes.MsgTake) (*baskettypes.MsgTakeResponse, error)
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 PulsarPageResToGogoPageRes ¶
func PulsarPageResToGogoPageRes(from *queryv1beta1.PageResponse) (*query.PageResponse, 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) Basket ¶
func (k Keeper) Basket(ctx context.Context, request *baskettypes.QueryBasketRequest) (*baskettypes.QueryBasketResponse, error)
func (Keeper) BasketBalance ¶
func (k Keeper) BasketBalance(ctx context.Context, request *baskettypes.QueryBasketBalanceRequest) (*baskettypes.QueryBasketBalanceResponse, error)
func (Keeper) BasketBalances ¶
func (k Keeper) BasketBalances(ctx context.Context, request *baskettypes.QueryBasketBalancesRequest) (*baskettypes.QueryBasketBalancesResponse, error)
func (Keeper) Baskets ¶
func (k Keeper) Baskets(ctx context.Context, request *baskettypes.QueryBasketsRequest) (*baskettypes.QueryBasketsResponse, error)
func (Keeper) Create ¶
func (k Keeper) Create(ctx context.Context, msg *basket.MsgCreate) (*basket.MsgCreateResponse, error)
Create is an RPC to handle basket.MsgCreate
func (Keeper) Put ¶
func (k Keeper) Put(ctx context.Context, req *baskettypes.MsgPut) (*baskettypes.MsgPutResponse, error)
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 ¶
func (k Keeper) Take(ctx context.Context, msg *baskettypes.MsgTake) (*baskettypes.MsgTakeResponse, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.