keeper

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 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.

func NewQuerier

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

NewQuerier is the module level router for state queries.

func RandomDelegator

func RandomDelegator(r *rand.Rand, k Keeper, ctx sdk.Context) (sdk.AccAddress, bool)

RandomDelegator returns a random delegator address given access to the keeper and ctx.

func RandomValidator

func RandomValidator(r *rand.Rand, k Keeper, ctx sdk.Context) (staking.Validator, bool)

RandomValidator returns a random validator given access to the keeper and ctx.

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, storeKey sdk.StoreKey, slashingKeeper types.SlashingKeeper, stakingKeeper types.StakingKeeper) Keeper

NewKeeper creates a new instance of the certifier keeper.

func (Keeper) CertifyPlatform

func (k Keeper) CertifyPlatform(ctx sdk.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 sdk.Context, certificate types.Certificate) error

DeleteCertificate deletes a certificate using its ID field.

func (Keeper) GetAllCertificates

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

GetAllCertificates gets all certificates.

func (Keeper) GetAllCertifiers

func (k Keeper) GetAllCertifiers(ctx sdk.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 sdk.Context, id uint64) (types.Certificate, error)

GetCertificateByID retrieves a certificate given an ID.

func (Keeper) GetCertificateType

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

GetCertificateType gets type of a certificate by certificate ID.

func (Keeper) GetCertificatesByCertifier

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

GetCertificatesByCertifier gets certificates certified by a given certifier.

func (Keeper) GetCertificatesByContent

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

GetCertificatesByContent retrieves all certificates with given content.

func (Keeper) GetCertificatesByTypeAndContent

func (k Keeper) GetCertificatesByTypeAndContent(ctx sdk.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 sdk.Context, params types.QueryCertificatesParams) (uint64, []types.Certificate, error)

GetCertificatesFiltered gets certificates filtered.

func (Keeper) GetCertifiedIdentities

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

GetCertifiedIdentities returns a list of addresses certified as identities.

func (Keeper) GetCertifier

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

GetCertifier returns the certification information for a certifier.

func (Keeper) GetCertifierByAlias

func (k Keeper) GetCertifierByAlias(ctx sdk.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 sdk.Context) uint64

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 sdk.Context, id uint64) bool

HasCertificateByID checks if a certificate exists given an ID.

func (Keeper) HasCertifierAlias

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

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 sdk.Context, address sdk.AccAddress) bool

IsBountyAdmin checks if an address is a bounty admin.

func (Keeper) IsCertified

func (k Keeper) IsCertified(ctx sdk.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 sdk.Context, address sdk.AccAddress) bool

IsCertifier checks if an address is a certifier.

func (Keeper) IsContentCertified

func (k Keeper) IsContentCertified(ctx sdk.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

IsLibrary checks if an address is a Certificate library.

func (Keeper) IssueCertificate

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

IssueCertificate issues a certificate.

func (Keeper) IterateAllCertificate

func (k Keeper) IterateAllCertificate(ctx sdk.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 sdk.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 sdk.Context, certificate types.Certificate, revoker sdk.AccAddress) error

RevokeCertificate revokes a certificate.

func (Keeper) SetCertificate

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

SetCertificate stores a certificate using its ID field.

func (Keeper) SetCertifier

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

SetCertifier sets a certifier.

func (Keeper) SetLibrary

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

SetLibrary sets a new Certificate library registry.

func (Keeper) SetNextCertificateID

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

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.

type QueryResCertificates

type QueryResCertificates struct {
	Total        uint64              `json:"total"`
	Certificates []types.Certificate `json:"certificates"`
}

func (QueryResCertificates) UnpackInterfaces

func (q QueryResCertificates) UnpackInterfaces(unpacker codecTypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

Jump to

Keyboard shortcuts

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