keeper

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package keeper specifies the keeper for the cert module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCertifierUpdateProposal

func HandleCertifierUpdateProposal(ctx sdk.Context, k Keeper, p *types.CertifierUpdateProposal) error

HandleCertifierUpdateProposal is a handler for executing a passed certifier update proposal

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

Keeper manages certifier & security council related logics.

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, slashingKeeper types.SlashingKeeper, stakingKeeper types.StakingKeeper) Keeper

NewKeeper creates a new instance of the certifier keeper.

func (Keeper) CertifyPlatform

func (k Keeper) CertifyPlatform(ctx context.Context, certifier sdk.AccAddress, validator cryptotypes.PubKey, description string) error

CertifyPlatform certifies a validator host platform by a certifier.

func (Keeper) DeleteCertificate

func (k Keeper) DeleteCertificate(ctx context.Context, certificate types.Certificate) error

DeleteCertificate deletes a certificate using its ID field.

func (Keeper) GetAllCertificates

func (k Keeper) GetAllCertificates(ctx context.Context) (certificates []types.Certificate)

GetAllCertificates gets all certificates.

func (Keeper) GetAllCertifiers

func (k Keeper) GetAllCertifiers(ctx context.Context) types.Certifiers

GetAllCertifiers gets all certifiers.

func (Keeper) GetAllLibraries

func (k Keeper) GetAllLibraries(ctx sdk.Context) (libraries types.Libraries)

GetAllLibraries gets all libraries.

func (Keeper) GetAllLibraryAddresses

func (k Keeper) GetAllLibraryAddresses(ctx sdk.Context) (libraryAddresses []sdk.AccAddress)

GetAllLibraryAddresses gets all library addresses.

func (Keeper) GetAllPlatforms

func (k Keeper) GetAllPlatforms(ctx sdk.Context) (platforms []types.Platform)

GetAllPlatforms gets all platform certificates for genesis export

func (Keeper) GetCertificateByID

func (k Keeper) GetCertificateByID(ctx context.Context, id uint64) (types.Certificate, error)

GetCertificateByID retrieves a certificate given an ID.

func (Keeper) GetCertificateType

func (k Keeper) GetCertificateType(ctx context.Context, id uint64) (types.CertificateType, error)

GetCertificateType gets type of a certificate by certificate ID.

func (Keeper) GetCertificatesByCertifier

func (k Keeper) GetCertificatesByCertifier(ctx context.Context, certifier sdk.AccAddress) []types.Certificate

GetCertificatesByCertifier gets certificates certified by a given certifier.

func (Keeper) GetCertificatesByContent

func (k Keeper) GetCertificatesByContent(ctx context.Context, content string) []types.Certificate

GetCertificatesByContent retrieves all certificates with given content.

func (Keeper) GetCertificatesByTypeAndContent

func (k Keeper) GetCertificatesByTypeAndContent(ctx context.Context, certType types.CertificateType, content string) []types.Certificate

GetCertificatesByTypeAndContent retrieves all certificates with given certificate type and content.

func (Keeper) GetCertificatesFiltered

func (k Keeper) GetCertificatesFiltered(ctx context.Context, params types.QueryCertificatesParams) (uint64, []types.Certificate, error)

GetCertificatesFiltered gets certificates filtered.

func (Keeper) GetCertifiedIdentities

func (k Keeper) GetCertifiedIdentities(ctx context.Context) []sdk.AccAddress

GetCertifiedIdentities returns a list of addresses certified as identities.

func (Keeper) GetCertifier

func (k Keeper) GetCertifier(ctx context.Context, certifierAddress sdk.AccAddress) (types.Certifier, error)

GetCertifier returns the certification information for a certifier.

func (Keeper) GetCertifierByAlias

func (k Keeper) GetCertifierByAlias(ctx context.Context, alias string) (types.Certifier, error)

GetCertifierByAlias returns the certification information for a certifier by its alias.

func (Keeper) GetNextCertificateID

func (k Keeper) GetNextCertificateID(ctx context.Context) (uint64, error)

GetNextCertificateID gets the next certificate ID from store.

func (Keeper) GetPlatform

func (k Keeper) GetPlatform(ctx sdk.Context, validator cryptotypes.PubKey) (types.Platform, bool)

GetPlatform returns the host platform of the validator.

func (Keeper) HasCertificateByID

func (k Keeper) HasCertificateByID(ctx context.Context, id uint64) (bool, error)

HasCertificateByID checks if a certificate exists given an ID.

func (Keeper) HasCertifierAlias

func (k Keeper) HasCertifierAlias(ctx context.Context, alias string) (bool, error)

HasCertifierAlias checks if the alias of a certifier exists.

func (Keeper) InvalidateLibrary

func (k Keeper) InvalidateLibrary(ctx sdk.Context, library sdk.AccAddress, invalidator sdk.AccAddress) error

InvalidateLibrary invalidate a Certificate library.

func (Keeper) IsBountyAdmin added in v2.9.0

func (k Keeper) IsBountyAdmin(ctx context.Context, address sdk.AccAddress) bool

IsBountyAdmin checks if an address is a bounty admin.

func (Keeper) IsCertified

func (k Keeper) IsCertified(ctx context.Context, content string, certType string) bool

IsCertified checks if a certificate of given type and content exists.

func (Keeper) IsCertifier

func (k Keeper) IsCertifier(ctx context.Context, address sdk.AccAddress) (bool, error)

IsCertifier checks if an address is a certifier.

func (Keeper) IsContentCertified

func (k Keeper) IsContentCertified(ctx context.Context, content string) bool

IsContentCertified checks if a certificate of given content exists.

func (Keeper) IsLibrary

func (k Keeper) IsLibrary(ctx sdk.Context, library sdk.AccAddress) (bool, error)

IsLibrary checks if an address is a Certificate library.

func (Keeper) IssueCertificate

func (k Keeper) IssueCertificate(ctx context.Context, c types.Certificate) (uint64, error)

IssueCertificate issues a certificate.

func (Keeper) IterateAllCertificate

func (k Keeper) IterateAllCertificate(ctx context.Context, callback func(certificate types.Certificate) (stop bool))

IterateAllCertificate iterates over the all the stored certificates and performs a callback function.

func (Keeper) IterateAllCertifiers

func (k Keeper) IterateAllCertifiers(ctx context.Context, callback func(certifier types.Certifier) (stop bool))

IterateAllCertifiers iterates over the all the stored certifiers and performs a callback function.

func (Keeper) IterateAllLibraries

func (k Keeper) IterateAllLibraries(ctx sdk.Context, callback func(library types.Library) (stop bool))

IterateAllLibraries iterates over the all the stored libraries and performs a callback function.

func (Keeper) PublishLibrary

func (k Keeper) PublishLibrary(ctx sdk.Context, library sdk.AccAddress, publisher sdk.AccAddress) error

PublishLibrary publishes a new Certificate library.

func (Keeper) RevokeCertificate

func (k Keeper) RevokeCertificate(ctx context.Context, certificate types.Certificate, revoker sdk.AccAddress) error

RevokeCertificate revokes a certificate.

func (Keeper) SetCertificate

func (k Keeper) SetCertificate(ctx context.Context, certificate types.Certificate) error

SetCertificate stores a certificate using its ID field.

func (Keeper) SetCertifier

func (k Keeper) SetCertifier(ctx context.Context, certifier types.Certifier) error

SetCertifier sets a certifier.

func (Keeper) SetLibrary

func (k Keeper) SetLibrary(ctx sdk.Context, library sdk.AccAddress, publisher sdk.AccAddress) error

SetLibrary sets a new Certificate library registry.

func (Keeper) SetNextCertificateID

func (k Keeper) SetNextCertificateID(ctx context.Context, id uint64) error

SetNextCertificateID sets the next certificate ID to store.

type Migrator added in v2.8.0

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v2.8.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v2.8.0

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper

func (Querier) AddrConversion added in v2.9.0

func (Querier) Certifier

Certifier queries a certifier given its address or alias.

func (Querier) Certifiers

Certifiers queries all certifiers.

Jump to

Keyboard shortcuts

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