keeper

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func ValidateProof

func ValidateProof(ctx sdk.Context, k Keeper, vc types.VerifiableCredential, verificationRelationships ...string) error

ValidateProof validate the proof of a verifiable credential

Types

type Keeper

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

Keeper holds the application data

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey,
	memKey sdk.StoreKey,
	didKeeper types.DidKeeper,
	accountKeeper types.AccountKeeper,
) *Keeper

NewKeeper create a new instance of a Keeper

func (Keeper) Delete

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

Delete - deletes a value form the store

func (Keeper) DeleteVerifiableCredentialFromStore

func (q Keeper) DeleteVerifiableCredentialFromStore(ctx sdk.Context, credentialID []byte, issuerAddress string) error

DeleteVerifiableCredentialFromStore deletes a verifiable credential from the store, it performs the necessary proof validation before executing the deletion

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

func (q Keeper) GetAllVerifiableCredentials(ctx sdk.Context) []types.VerifiableCredential

func (Keeper) GetAllVerifiableCredentialsByIssuer

func (q Keeper) GetAllVerifiableCredentialsByIssuer(ctx sdk.Context, issuerDID string) []types.VerifiableCredential

GetAllVerifiableCredentialsByIssuer returns all verifiable credentials issued by an issuer

func (Keeper) GetAllVerifiableCredentialsWithCondition

func (q Keeper) GetAllVerifiableCredentialsWithCondition(
	ctx sdk.Context,
	key []byte,
	vcSelector func(votes types.VerifiableCredential) bool,
) (vcs []types.VerifiableCredential)

func (Keeper) GetVerifiableCredential

func (q Keeper) GetVerifiableCredential(ctx sdk.Context, key []byte) (types.VerifiableCredential, bool)

GetVerifiableCredential regurns the verifiable credentials associated with an key

func (Keeper) GetVerifiableCredentialWithType

func (q Keeper) GetVerifiableCredentialWithType(ctx sdk.Context, subjectDID, vcType string) (vcs []types.VerifiableCredential)

GetVerifiableCredentialWithType returns the list of verifiable credential of a certain type for an holder (the subject of the credential)

func (Keeper) Logger

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

func (Keeper) MarshalVerifiableCredential

func (q Keeper) MarshalVerifiableCredential(value interface{}) []byte

func (Keeper) Set

func (k Keeper) Set(ctx sdk.Context,
	key []byte,
	prefix []byte,
	i interface{},
	marshal MarshalFn,
)

Set sets a value in the db with a prefixed key

func (Keeper) SetVerifiableCredential

func (q Keeper) SetVerifiableCredential(ctx sdk.Context, key []byte, vc types.VerifiableCredential) (err error)

SetVerifiableCredential commit a verifiable credential to the storage

func (Keeper) UnmarshalVerifiableCredential

func (q Keeper) UnmarshalVerifiableCredential(value []byte) (interface{}, bool)

func (Keeper) VerifiableCredential

VerifiableCredential queries verifiable credentials info for given verifiable credentials id

func (Keeper) VerifiableCredentials

VerifiableCredentials implements the VerifiableCredentials gRPC method

type MarshalFn

type MarshalFn func(value interface{}) []byte

MarshalFn is a generic function to marshal interfaces

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