keeper

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for credit clients.

Types

type Keeper

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

Keeper of the credit store

func NewKeeper

func NewKeeper(cdc *codec.Codec, ak types.AccountKeeper, key sdk.StoreKey, paramstore types.ParamSubspace) Keeper

NewKeeper creates a credit keeper

func (Keeper) Add

func (k Keeper) Add(ctx sdk.Context, address sdk.AccAddress, amount sdk.Int) (sdk.Int, error)

Add a number of credits to an address

func (*Keeper) Export

func (k *Keeper) Export(ctx sdk.Context) (map[string]sdk.Int, error)

Export all credits from the keeper.

func (Keeper) Get

func (k Keeper) Get(ctx sdk.Context, address sdk.AccAddress) (sdk.Int, error)

Get the balance of a specific address

func (Keeper) GetParams

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

GetParams returns all the params of the module

func (*Keeper) Import

func (k *Keeper) Import(ctx sdk.Context, credits map[string]sdk.Int) error

Import all credits into the keeper.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Minters

func (k Keeper) Minters(ctx sdk.Context) []sdk.AccAddress

Minters are authorized account that can add credits to any address.

func (Keeper) SetParams

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

SetParams will populate all the params

func (Keeper) Sub

func (k Keeper) Sub(ctx sdk.Context, address sdk.AccAddress, amount sdk.Int) (sdk.Int, error)

Sub a number of credits to an address

Jump to

Keyboard shortcuts

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