keeper

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UpdatedPostfix string = "-updated"

Variables

This section is empty.

Functions

func DuplicateSignatures

func DuplicateSignatures(signatures []*types.SignInfo, didToDuplicate string, newDid string) []*types.SignInfo

func FindDid

func FindDid(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, did string) (res types.StateValue, found bool, err error)

func FindVerificationMethod

func FindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, didUrl string) (res types.VerificationMethod, found bool, err error)

func GetDidIDBytes

func GetDidIDBytes(id string) []byte

GetDidIDBytes returns the byte representation of the ID

func GetSignerDIDsForDIDCreation

func GetSignerDIDsForDIDCreation(did types.Did) []string

func GetSignerDIDsForDIDUpdate

func GetSignerDIDsForDIDUpdate(existingDid types.Did, updatedDid types.Did) []string

func GetSignerIdForErrorMessage

func GetSignerIdForErrorMessage(signerId string, existingVersionId string, updatedVersionId string) interface{}

func MustFindDid

func MustFindDid(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, did string) (res types.StateValue, err error)

func MustFindVerificationMethod

func MustFindVerificationMethod(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, didUrl string) (res types.VerificationMethod, err error)

func NewMsgServer

func NewMsgServer(keeper Keeper) types.MsgServer

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

func NewQuerier

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

func NewQueryServer

func NewQueryServer(keeper Keeper) types.QueryServer

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

func VerifyAllSignersHaveAllValidSignatures added in v0.6.0

func VerifyAllSignersHaveAllValidSignatures(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, message []byte, signers []string, signatures []*types.SignInfo) error

func VerifyAllSignersHaveAtLeastOneValidSignature added in v0.6.0

func VerifyAllSignersHaveAtLeastOneValidSignature(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue,
	message []byte, signers []string, signatures []*types.SignInfo, DIDToBeUpdated string, updatedDID string,
) error

VerifyAllSignersHaveAtLeastOneValidSignature verifies that all signers have at least one valid signature. Omit DIDtoBeUpdated and updatedDID if not updating a DID. Otherwise those values will be used to better format error messages.

func VerifySignature

func VerifySignature(k *Keeper, ctx *sdk.Context, inMemoryDIDs map[string]types.StateValue, message []byte, signature types.SignInfo) error

Types

type Keeper

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

func NewKeeper

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

func (Keeper) DeleteFromState added in v0.6.0

func (k Keeper) DeleteFromState(ctx *sdk.Context, stateKey string)

DeleteFromState - remove value from State by key

func (Keeper) GetAllDid

func (k Keeper) GetAllDid(ctx *sdk.Context) (list []types.StateValue)

GetAllDid returns all did Loads all DIDs in memory. Use only for genesis export.

func (Keeper) GetDid

func (k Keeper) GetDid(ctx *sdk.Context, id string) (types.StateValue, error)

GetDid returns a did from its id

func (Keeper) GetDidCount

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

GetDidCount get the total number of did

func (Keeper) GetDidNamespace

func (k Keeper) GetDidNamespace(ctx *sdk.Context) string

GetDidNamespace get did namespace

func (Keeper) GetFromState

func (k Keeper) GetFromState(ctx *sdk.Context, stateKey string) string

GetFromState - get State value

func (Keeper) HasDid

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

HasDid checks if the did exists in the store

func (Keeper) Logger

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

func (Keeper) SetDid

func (k Keeper) SetDid(ctx *sdk.Context, stateValue *types.StateValue) error

SetDid set a specific did in the store. Updates DID counter if the DID is new.

func (Keeper) SetDidCount

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

SetDidCount set the total number of did

func (Keeper) SetDidNamespace

func (k Keeper) SetDidNamespace(ctx *sdk.Context, namespace string)

SetDidNamespace set did namespace

func (Keeper) SetToState

func (k Keeper) SetToState(ctx *sdk.Context, stateKey string, stateValue []byte)

SetToState - set State value

Jump to

Keyboard shortcuts

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