keeper

package
v3.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) didmod.MsgServer

NewMsgServerImpl returns an implementation of the identity MsgServer interface for the provided Keeper.

Types

type Keeper

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

Keeper defines the Keeper for the did module

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey, memKey sdk.StoreKey) *Keeper

NewKeeper instanstiates the Keeper for the did module

func (Keeper) Delete

func (k Keeper) Delete(
	ctx sdk.Context,
	key []byte,
	prefix []byte,
)

Delete deletes a value form the store

func (Keeper) DidDocument

DidDocument implements the DidDocument gRPC method, it querys the store and returns a did document to a gRPC client

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx types.Context, cdc codec.JSONCodec) *did.GenesisState

ExportGenesis exports the did state to a genesis.json file

func (Keeper) Get

func (k Keeper) Get(
	ctx sdk.Context,
	key []byte,
	prefix []byte,
	unmarshal UnmarshalFn,
) (i interface{}, found bool)

Get gets an item from the store by bytes

func (Keeper) GetAll

func (k Keeper) GetAll(
	ctx sdk.Context,
	prefix []byte,
) sdk.Iterator

GetAll values from with a prefix from the store

func (Keeper) GetAllDidDocuments

func (k Keeper) GetAllDidDocuments(ctx sdk.Context) []*did.DidDocument

GetAllDidDocuments returns all the DidDocuments

func (Keeper) GetAllDidDocumentsWithCondition

func (k Keeper) GetAllDidDocumentsWithCondition(
	ctx sdk.Context,
	key []byte,
	didSelector func(did *did.DidDocument) bool,
) (didDocs []*did.DidDocument)

GetAllDidDocumentsWithCondition retrieve a list of did document by some arbitrary criteria. The selector filter has access to both the did and its metadata

func (Keeper) GetDidDocument

func (k Keeper) GetDidDocument(ctx sdk.Context, key []byte) (did.DidDocument, bool)

GetDidDocument retrieve a DID document by its key. The boolean return will be false if the DID document is not found

func (Keeper) Has

func (k Keeper) Has(
	ctx sdk.Context,
	key []byte,
	prefix []byte,
) (found bool)

Has returns a bool if item is in the store

func (Keeper) HasDidDocument

func (k Keeper) HasDidDocument(ctx sdk.Context, key []byte) bool

HasDidDocument checks if a DID document is in the store by its key. The boolean return will be false if the DID document is not found

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(
	ctx types.Context,
	cdc codec.JSONCodec,
	data json.RawMessage,
) []abci.ValidatorUpdate

InitGenesis initializes the genesis state for the did module

func (Keeper) Logger

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

Logger defines the logger for the did module

func (Keeper) ResolveDid

func (k Keeper) ResolveDid(
	ctx sdk.Context,
	didDoc did.DID,
) (doc did.DidDocument, err error)

ResolveDid returns the did document if its a did:key or did:cosmos this function is used to resolve ephemeral dids

func (Keeper) Set

func (k Keeper) Set(ctx sdk.Context,
	key []byte,
	prefix []byte,
	i codec.ProtoMarshaler,
	marshal MarshalFn,
)

Set sets a value in the db with a prefixed key

func (Keeper) SetDidDocument

func (k Keeper) SetDidDocument(ctx sdk.Context, key []byte, document did.DidDocument)

SetDidDocument store a did document in the keeper, existing DID document with the same key will be overwritten

func (Keeper) UnmarshalDidDocument

func (k Keeper) UnmarshalDidDocument(value []byte) (interface{}, bool)

UnmarshalDidDocument unmarshall a did document and check if it is empty ad DID document is empty if contains no context

type MarshalFn

type MarshalFn func(o codec.ProtoMarshaler) []byte

MarshalFn is a generic function to marshal bytes

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

type UnmarshalFn

type UnmarshalFn func(value []byte) (interface{}, bool)

UnmarshalFn is a generic function to unmarshal bytes

Jump to

Keyboard shortcuts

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