Documentation ¶
Overview ¶
Package keeper specifies the keeper for the cert module.
Index ¶
- Constants
- func HandleCertifierUpdateProposal(ctx sdk.Context, k Keeper, p types.CertifierUpdateProposal) error
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) CertifyPlatform(ctx sdk.Context, certifier sdk.AccAddress, validator crypto.PubKey, ...) error
- func (k Keeper) CertifyValidator(ctx sdk.Context, validator crypto.PubKey, certifier sdk.AccAddress) error
- func (k Keeper) DecertifyValidator(ctx sdk.Context, valPubKey crypto.PubKey, decertifier sdk.AccAddress) error
- func (k Keeper) DeleteCertificate(ctx sdk.Context, certificate types.Certificate) error
- func (k Keeper) GetAllCertificates(ctx sdk.Context) (certificates []types.Certificate)
- func (k Keeper) GetAllCertifiers(ctx sdk.Context) types.Certifiers
- func (k Keeper) GetAllLibraries(ctx sdk.Context) (libraries types.Libraries)
- func (k Keeper) GetAllLibraryAddresses(ctx sdk.Context) (libraryAddresses []sdk.AccAddress)
- func (k Keeper) GetAllPlatforms(ctx sdk.Context) (platforms []types.Platform)
- func (k Keeper) GetAllValidatorPubkeys(ctx sdk.Context) (validatorAddresses []string)
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators types.Validators)
- func (k Keeper) GetCertificateByID(ctx sdk.Context, id types.CertificateID) (types.Certificate, error)
- func (k Keeper) GetCertificateType(ctx sdk.Context, id types.CertificateID) (types.CertificateType, error)
- func (k Keeper) GetCertificatesByCertifier(ctx sdk.Context, certifier sdk.AccAddress) []types.Certificate
- func (k Keeper) GetCertificatesByContent(ctx sdk.Context, requestContent types.RequestContent) []types.Certificate
- func (k Keeper) GetCertificatesByTypeAndContent(ctx sdk.Context, certType types.CertificateType, ...) []types.Certificate
- func (k Keeper) GetCertificatesFiltered(ctx sdk.Context, params types.QueryCertificatesParams) (uint64, []types.Certificate, error)
- func (k Keeper) GetCertifier(ctx sdk.Context, certifierAddress sdk.AccAddress) (types.Certifier, error)
- func (k Keeper) GetCertifierByAlias(ctx sdk.Context, alias string) (types.Certifier, error)
- func (k Keeper) GetNewCertificateID(ctx sdk.Context, certType types.CertificateType, ...) (types.CertificateID, error)
- func (k Keeper) GetPlatform(ctx sdk.Context, validator crypto.PubKey) (string, bool)
- func (k Keeper) GetValidator(ctx sdk.Context, validator crypto.PubKey) ([]byte, bool)
- func (k Keeper) GetValidatorCertifier(ctx sdk.Context, validator crypto.PubKey) (sdk.AccAddress, error)
- func (k Keeper) HasCertificateByID(ctx sdk.Context, id types.CertificateID) bool
- func (k Keeper) HasCertifierAlias(ctx sdk.Context, alias string) bool
- func (k Keeper) InvalidateLibrary(ctx sdk.Context, library sdk.AccAddress, invalidator sdk.AccAddress) error
- func (k Keeper) IsCertified(ctx sdk.Context, requestContentType string, content string, certType string) bool
- func (k Keeper) IsCertifier(ctx sdk.Context, address sdk.AccAddress) bool
- func (k Keeper) IsContentCertified(ctx sdk.Context, requestContent string) bool
- func (k Keeper) IsLibrary(ctx sdk.Context, library sdk.AccAddress) bool
- func (k Keeper) IsValidatorCertified(ctx sdk.Context, validator crypto.PubKey) bool
- func (k Keeper) IssueCertificate(ctx sdk.Context, c types.Certificate) (types.CertificateID, error)
- func (k Keeper) IterateAllCertificate(ctx sdk.Context, callback func(certificate types.Certificate) (stop bool))
- func (k Keeper) IterateAllCertifiers(ctx sdk.Context, callback func(certifier types.Certifier) (stop bool))
- func (k Keeper) IterateAllLibraries(ctx sdk.Context, callback func(library types.Library) (stop bool))
- func (k Keeper) IterateAllValidators(ctx sdk.Context, callback func(validator types.Validator) (stop bool))
- func (k Keeper) IterateCertificatesByContent(ctx sdk.Context, certType types.CertificateType, content types.RequestContent, ...)
- func (k Keeper) PublishLibrary(ctx sdk.Context, library sdk.AccAddress, publisher sdk.AccAddress) error
- func (k Keeper) RevokeCertificate(ctx sdk.Context, certificate types.Certificate, revoker sdk.AccAddress) error
- func (k Keeper) SetCertificate(ctx sdk.Context, certificate types.Certificate)
- func (k Keeper) SetCertifier(ctx sdk.Context, certifier types.Certifier)
- func (k Keeper) SetLibrary(ctx sdk.Context, library sdk.AccAddress, publisher sdk.AccAddress)
- func (k Keeper) SetValidator(ctx sdk.Context, validator crypto.PubKey, certifier sdk.AccAddress)
- type QueryResCertificate
- type QueryResCertificates
- type QueryResRequestContent
Constants ¶
const MaxTimestamp = 253402300799
Max timestamp supported by Amino. Dec 31, 9999 - 23:59:59 GMT
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 NewQuerier ¶
NewQuerier is the module level router for state queries.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper manages certifier & security council related logics.
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, 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 crypto.PubKey, description string) error
CertifyPlatform certifies a validator host platform by a certifier.
func (Keeper) CertifyValidator ¶
func (k Keeper) CertifyValidator(ctx sdk.Context, validator crypto.PubKey, certifier sdk.AccAddress) error
CertifyValidator certifies a validator.
func (Keeper) DecertifyValidator ¶
func (k Keeper) DecertifyValidator(ctx sdk.Context, valPubKey crypto.PubKey, decertifier sdk.AccAddress) error
DecertifyValidator de-certifies a certified validator.
func (Keeper) DeleteCertificate ¶
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 ¶
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 ¶
GetAllPlatforms gets all platform certificates for genesis export
func (Keeper) GetAllValidatorPubkeys ¶
GetAllValidatorPubkeys gets all validator pubkeys.
func (Keeper) GetAllValidators ¶
func (k Keeper) GetAllValidators(ctx sdk.Context) (validators types.Validators)
GetAllValidators gets all validators.
func (Keeper) GetCertificateByID ¶
func (k Keeper) GetCertificateByID(ctx sdk.Context, id types.CertificateID) (types.Certificate, error)
GetCertificateByID retrieves a certificate given an ID.
func (Keeper) GetCertificateType ¶
func (k Keeper) GetCertificateType(ctx sdk.Context, id types.CertificateID) (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, requestContent types.RequestContent) []types.Certificate
GetCertificatesByContent retrieves all certificates with given content.
func (Keeper) GetCertificatesByTypeAndContent ¶
func (k Keeper) GetCertificatesByTypeAndContent(ctx sdk.Context, certType types.CertificateType, requestContent types.RequestContent) []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) 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 ¶
GetCertifierByAlias returns the certification information for a certifier by its alias.
func (Keeper) GetNewCertificateID ¶
func (k Keeper) GetNewCertificateID(ctx sdk.Context, certType types.CertificateType, certContent types.RequestContent) (types.CertificateID, error)
GetNewCertificateID gets an unused certificate ID for a new certificate.
func (Keeper) GetPlatform ¶
GetPlatform returns the host platform of the validator.
func (Keeper) GetValidator ¶
GetValidator returns the validator.
func (Keeper) GetValidatorCertifier ¶
func (k Keeper) GetValidatorCertifier(ctx sdk.Context, validator crypto.PubKey) (sdk.AccAddress, error)
GetValidatorCertifier gets the original certifier of the validator.
func (Keeper) HasCertificateByID ¶
HasCertificateByID checks if a certificate exists given an ID.
func (Keeper) HasCertifierAlias ¶
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) IsCertified ¶
func (k Keeper) IsCertified(ctx sdk.Context, requestContentType string, content string, certType string) bool
IsCertified checks if a certificate of given type and content exists.
func (Keeper) IsCertifier ¶
IsCertifier checks if an address is a certifier.
func (Keeper) IsContentCertified ¶
IsContentCertified checks if a certificate of given content exists.
func (Keeper) IsValidatorCertified ¶
IsValidatorCertified checks if the validator is current certified.
func (Keeper) IssueCertificate ¶
func (k Keeper) IssueCertificate(ctx sdk.Context, c types.Certificate) (types.CertificateID, 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) IterateAllValidators ¶
func (k Keeper) IterateAllValidators(ctx sdk.Context, callback func(validator types.Validator) (stop bool))
IterateAllValidators iterates over the all the stored validators and performs a callback function.
func (Keeper) IterateCertificatesByContent ¶
func (k Keeper) IterateCertificatesByContent(ctx sdk.Context, certType types.CertificateType, content types.RequestContent, callback func(certificate types.Certificate) (stop bool))
IterateCertificatesByContent iterates over certificates with identical given certifier, certificate type, and certificate content.
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 ¶
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) SetValidator ¶
SetValidator sets a certified validator.
type QueryResCertificate ¶
type QueryResCertificate struct { CertificateID string `json:"certificate_id"` CertificateType string `json:"certificate_type"` RequestContent QueryResRequestContent `json:"request_content"` CertificateContent []types.KVPair `json:"certificate_content"` Description string `json:"description"` Certifier string `json:"certifier"` TxHash string `json:"txhash"` }
func NewQueryResCertificate ¶
func NewQueryResCertificate( certificateID string, certificateType string, requestContent types.RequestContent, certificateContent []types.KVPair, description string, certifier string, txhash string, ) QueryResCertificate
type QueryResCertificates ¶
type QueryResCertificates struct { Total uint64 `json:"total"` Certificates []QueryResCertificate `json:"certificates"` }
type QueryResRequestContent ¶
type QueryResRequestContent struct { RequestContentType types.RequestContentType `json:"request_content_type"` RequestContentTypeName string `json:"request_content_type_name"` RequestContent string `json:"request_content"` }
func NewQueryResRequestContent ¶
func NewQueryResRequestContent( requestContentType types.RequestContentType, requestContentTypeName string, requestContent string, ) QueryResRequestContent