keeper

package
v2.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 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) credential.MsgServer

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

func ValidateProof

func ValidateProof(ctx sdk.Context, k Keeper, wc *credential.WrappedCredential, verificationRelationships ...string) (err error)

ValidateProof validate the proof of a verifiable credential

Types

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey, memKey sdk.StoreKey, did credential.DidKeeper, account credential.AccountKeeper) *Keeper

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) GetCredentialDefinition

func (k Keeper) GetCredentialDefinition(ctx sdk.Context, key string) (credential.CredentialDefinition, bool)

GetCredentialDefinition retrieve a credential definition by its key. The boolean return will be false if the credential definition is not found

func (Keeper) GetCredentialDefinitions

func (k Keeper) GetCredentialDefinitions(ctx sdk.Context, req *credential.QueryCredentialDefinitionsRequest) (cds []*credential.CredentialDefinition, pageRes *query.PageResponse, err error)

GetCredentialDefinitions list credential definitions

func (Keeper) GetCredentialDefinitionsWithFilter

func (k Keeper) GetCredentialDefinitionsWithFilter(ctx sdk.Context, filter func(credentialDefinition *credential.CredentialDefinition) bool) []*credential.CredentialDefinition

GetCredentialDefinitionsWithFilter retrieve a list of credential definitions with filter

func (Keeper) GetPublicCredential

func (k Keeper) GetPublicCredential(ctx sdk.Context, key string) (credential.PublicVerifiableCredential, bool)

GetPublicCredential retrieve a public verifiable credential by its key. The boolean return will be false if the credential is not found

func (Keeper) GetPublicCredentialWithFilter

func (k Keeper) GetPublicCredentialWithFilter(ctx sdk.Context, filter func(verifiableCredential *credential.PublicVerifiableCredential) bool) []*credential.PublicVerifiableCredential

GetPublicCredentialWithFilter retrieve a list of verifiable credentials filtered by properties

func (Keeper) Logger

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

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) SetCredentialDefinition

func (k Keeper) SetCredentialDefinition(ctx sdk.Context, def *credential.CredentialDefinition)

SetCredentialDefinition persist a credential definition to the store. The credential definition ID is used as key.

func (Keeper) SetPublicCredential

func (k Keeper) SetPublicCredential(ctx sdk.Context, pc *credential.PublicVerifiableCredential)

SetPublicCredential persist a public verifiable credential to the store. The credential ID is used as key

func (Keeper) Unmarshal

func (k Keeper) Unmarshal(data []byte, val codec.ProtoMarshaler) bool

Unmarshal from byte slice to a struct, return false in case of errors

type MarshalFn

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

MarshalFn is a generic function to marshal bytes

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