keeper

package
v1.1.2-develop.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAlternativeURITemplate    = "did:cheqd:%s:%s/resources/%s"
	DefaultAlternaticeURIDescription = "did-url"
)

Variables

This section is empty.

Functions

func NewMsgServer

func NewMsgServer(keeper Keeper, cheqdKeeper didkeeper.Keeper) types.MsgServer

NewMsgServer returns an implementation of the MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(k Keeper, cheqdKeeper didkeeper.Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

func NewQueryServer

func NewQueryServer(keeper Keeper, cheqdKeeper didkeeper.Keeper) types.QueryServer

NewQueryServer returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSpace types.ParamSubspace) *Keeper

func (Keeper) AddNewResourceVersion added in v0.8.0

func (k Keeper) AddNewResourceVersion(ctx *sdk.Context, resource *types.ResourceWithMetadata) error

func (Keeper) GetAllResources

func (k Keeper) GetAllResources(ctx *sdk.Context) (list []*types.ResourceWithMetadata, iterErr error)

GetAllResources returns all resources as a list Loads everything in memory. Use only for genesis export!

func (Keeper) GetLastResourceVersionMetadata added in v0.8.0

func (k Keeper) GetLastResourceVersionMetadata(ctx *sdk.Context, collectionID, name, resourceType string) (types.Metadata, bool)

func (Keeper) GetParams added in v0.8.0

func (k Keeper) GetParams(ctx sdk.Context) (params types.FeeParams)

func (Keeper) GetResource

func (k Keeper) GetResource(ctx *sdk.Context, collectionID string, id string) (types.ResourceWithMetadata, error)

GetResource returns a resource from its id

func (Keeper) GetResourceCollection

func (k Keeper) GetResourceCollection(ctx *sdk.Context, collectionID string) []*types.Metadata

func (Keeper) GetResourceCount

func (k Keeper) GetResourceCount(ctx *sdk.Context) uint64

GetResourceCount get the total number of resource

func (Keeper) GetResourceMetadata added in v0.8.0

func (k Keeper) GetResourceMetadata(ctx *sdk.Context, collectionID string, id string) (types.Metadata, error)

func (Keeper) HasResource

func (k Keeper) HasResource(ctx *sdk.Context, collectionID string, id string) bool

HasResource checks if the resource exists in the store

func (Keeper) IterateAllResourceMetadatas added in v0.8.0

func (k Keeper) IterateAllResourceMetadatas(ctx *sdk.Context, callback func(metadata types.Metadata) (continue_ bool))

func (Keeper) Logger

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

func (Keeper) SetParams added in v0.8.0

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

func (Keeper) SetResource

func (k Keeper) SetResource(ctx *sdk.Context, resource *types.ResourceWithMetadata) error

SetResource create or update a specific resource in the store

func (Keeper) SetResourceCount

func (k Keeper) SetResourceCount(ctx *sdk.Context, count uint64)

SetResourceCount set the total number of resource

func (Keeper) UpdateResourceMetadata added in v0.8.0

func (k Keeper) UpdateResourceMetadata(ctx *sdk.Context, metadata *types.Metadata) error

UpdateResourceMetadata update the metadata of a resource. Returns an error if the resource doesn't exist

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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