keeper

package
v0.0.0-...-8c42a47 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryEntityDoc = "queryEntityDoc"
)

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k Keeper) types.MsgServer

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

func NewQuerier

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

Types

type Keeper

type Keeper struct {
	IidKeeper      iidkeeper.Keeper
	WasmKeeper     wasmtypes.ContractOpsKeeper
	WasmViewKeeper wasmtypes.ViewKeeper
	ParamSpace     paramstypes.Subspace
	AccountKeeper  authkeeper.AccountKeeper
	AuthzKeeper    authzkeeper.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, memStoreKey sdk.StoreKey, iidKeeper iidkeeper.Keeper, wasmKeeper wasmkeeper.Keeper,
	paramSpace paramstypes.Subspace, accountKeeper authkeeper.AccountKeeper, authzKeeper authzkeeper.Keeper) Keeper

func (Keeper) CheckIfOwner

func (k Keeper) CheckIfOwner(ctx sdk.Context, entityId, ownerAddress string) error

checks if the provided address is the owner on the smart contract

func (Keeper) CreateNewAccount

func (k Keeper) CreateNewAccount(ctx sdk.Context, entityId, name string) (sdk.AccAddress, error)

Create a module account for entity id and name of account as fragemnt in form: did#name

func (Keeper) Delete

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

Delete - deletes a value form the store

func (Keeper) Entity

func (Keeper) EntityExists

func (k Keeper) EntityExists(ctx sdk.Context, entityDid string) bool

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

func (k Keeper) GetAllEntity(ctx sdk.Context) []types.Entity

GetAllEntity returns all the Entity docs

func (Keeper) GetAllEntityWithCondition

func (k Keeper) GetAllEntityWithCondition(
	ctx sdk.Context,
	key []byte,
	entitySelector func(entity types.Entity) bool,
) (entities []types.Entity)

GetAllEntityWithCondition retrieve a list of entitiy docs by some arbitrary criteria.

func (Keeper) GetEntity

func (k Keeper) GetEntity(ctx sdk.Context, key []byte) (types.Entity, bool)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of project parameters.

func (Keeper) Logger

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

func (Keeper) Marshal

func (k Keeper) Marshal(value interface{}) (bytes []byte)

func (Keeper) Params

func (Keeper) ResolveEntity

func (k Keeper) ResolveEntity(ctx sdk.Context, entityId string) (iidDocument iidTypes.IidDocument, entity types.Entity, err error)

ResolveEntity returns the Entity and IidDocument

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

func (k Keeper) SetEntity(ctx sdk.Context, key []byte, meta types.Entity)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params *types.Params)

SetParams sets the total set of project parameters.

func (Keeper) Unmarshal

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

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

func (Keeper) UnmarshalEntity

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

type MarshalFn

type MarshalFn func(value interface{}) []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