keeper

package
v0.0.0-...-6bfe187 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for scx clients.

Types

type Keeper

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

Keeper of the scx store

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, poa types.PoaKeeper) Keeper

NewKeeper creates a scx keeper

func (Keeper) AppendProduct

func (k Keeper) AppendProduct(ctx sdk.Context, product types.Product) (alreadyExist bool)

Append a product

func (Keeper) AppendUnit

func (k Keeper) AppendUnit(ctx sdk.Context, unit types.Unit) (alreadyExist bool)

Append an unit

func (Keeper) GetAllOrganizations

func (k Keeper) GetAllOrganizations(ctx sdk.Context) (organizations []types.Organization)

Get the set of all organizations

func (Keeper) GetAllProducts

func (k Keeper) GetAllProducts(ctx sdk.Context) (products []types.Product)

Retrieve all products

func (Keeper) GetOrganization

func (k Keeper) GetOrganization(ctx sdk.Context, addr sdk.AccAddress) (organization types.Organization, found bool)

Get on organization

func (Keeper) GetProduct

func (k Keeper) GetProduct(ctx sdk.Context, name string) (product types.Product, found bool)

Fetch one product from its name

func (Keeper) GetUnit

func (k Keeper) GetUnit(ctx sdk.Context, reference string) (unit types.Unit, found bool)

Fetch a unit from its reference

func (Keeper) GetUnitComponents

func (k Keeper) GetUnitComponents(ctx sdk.Context, reference string) (components []types.Unit, found bool)

Get all the component units of the unit

func (Keeper) GetUnitTrace

func (k Keeper) GetUnitTrace(ctx sdk.Context, reference string) (trace []sdk.AccAddress, found bool)

Get the list of all the holder

func (Keeper) IncreaseProductCount

func (k Keeper) IncreaseProductCount(ctx sdk.Context, name string) (found bool)

Increase the count of a product

func (Keeper) IsAuthority

func (k Keeper) IsAuthority(ctx sdk.Context, addr sdk.ValAddress) bool

Verify if an address is an authority (an authority is in the validator set)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetOrganization

func (k Keeper) SetOrganization(ctx sdk.Context, organization types.Organization)

Set organization details

func (Keeper) SetUnit

func (k Keeper) SetUnit(ctx sdk.Context, unit types.Unit)

Set unit

Jump to

Keyboard shortcuts

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