keeper

package
v4.0.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) *credential.GenesisState

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, genState *credential.GenesisState)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) credential.MsgServer

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

func NewPublicCredentialProposalHandler

func NewPublicCredentialProposalHandler(k Keeper) govtypes.Handler

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

func (k Keeper) AllowPublicCredential(ctx sdk.Context, id string)

func (Keeper) CredentialDefinition

CredentialDefinition returns credential definition for an id

func (Keeper) CredentialDefinitions

CredentialDefinitions returns all credential definitions

func (Keeper) CredentialDefinitionsByPublisher

CredentialDefinitionsByPublisher returns credential definitions for a particular publisher id

func (Keeper) Exists

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

func (Keeper) Get

func (k Keeper) Get(
	ctx sdk.Context,
	prefix []byte,
	key []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) GetAllowedCredentialDefinitions

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

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, paginate *query.PageRequest, filter func(credentialDefinition *credential.CredentialDefinition) bool) (cds []*credential.CredentialDefinition, pageRes *query.PageResponse, err error)

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, pagination *query.PageRequest, filter func(verifiableCredential *credential.PublicVerifiableCredential) bool) (pvcs []*credential.PublicVerifiableCredential, pageRes *query.PageResponse, err error)

GetPublicCredentialWithFilter retrieve a list of verifiable credentials filtered by properties

func (Keeper) IsPublicCredentialDefinitionAllowed

func (k Keeper) IsPublicCredentialDefinitionAllowed(ctx sdk.Context, id string) bool

func (Keeper) Logger

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

func (Keeper) PublicCredential

PublicCredential returns public credential for a particular id

func (Keeper) PublicCredentials

PublicCredentials returns all public credentials

func (Keeper) PublicCredentialsByHolder

PublicCredentialsByHolder returns public credentials for particular holder

func (Keeper) PublicCredentialsByIssuer

PublicCredentialsByIssuer returns public credentials for a particular issuer

func (Keeper) RemovePublicCredentialFromAllowedList

func (k Keeper) RemovePublicCredentialFromAllowedList(ctx sdk.Context, id string)

func (Keeper) Set

func (k Keeper) Set(ctx sdk.Context,
	prefix []byte,
	key []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