keeper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryComplianceInfo           = "compliance_info"
	QueryAllComplianceInfoRecords = "all_compliance_info_records"
	QueryCertifiedModel           = "certified_model"
	QueryAllCertifiedModels       = "all_certified_models"
	QueryRevokedModel             = "revoked_model"
	QueryAllRevokedModels         = "all_revoked_models"
)

Variables

This section is empty.

Functions

func CheckComplianceInfo

func CheckComplianceInfo(t *testing.T, expected types.ComplianceInfo, received types.ComplianceInfo)

func DefaultCertifiedModel

func DefaultCertifiedModel() types.ComplianceInfo

func DefaultRevokedModel

func DefaultRevokedModel() types.ComplianceInfo

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

func PopulateStoreWithMixedModels

func PopulateStoreWithMixedModels(setup TestSetup, count int) uint16

add n=count/2 certified and count-n revoked models {VID: 1, PID: 1..count}.

func PopulateStoreWithModels

func PopulateStoreWithModels(setup TestSetup, firstID uint16, count int, complianceInfo types.ComplianceInfo) uint16

add n models {VID: 1, PID: 1..count}.

Types

type Keeper

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

func NewKeeper

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

func (Keeper) CountTotalComplianceInfo

func (k Keeper) CountTotalComplianceInfo(ctx sdk.Context, certificationType types.CertificationType) int

func (Keeper) GetComplianceInfo

func (k Keeper) GetComplianceInfo(ctx sdk.Context, certificationType types.CertificationType,
	vid uint16, pid uint16, softwareVersion uint32) types.ComplianceInfo

Gets the entire ComplianceInfo struct for a ComplianceInfoID.

func (Keeper) IsComplianceInfoPresent

func (k Keeper) IsComplianceInfoPresent(ctx sdk.Context,
	certificationType types.CertificationType, vid uint16, pid uint16, softwareVersion uint32) bool

Check if the ComplianceInfo is present in the store or not.

func (Keeper) IterateComplianceInfos

func (k Keeper) IterateComplianceInfos(ctx sdk.Context, certificationType types.CertificationType,
	process func(info types.ComplianceInfo) (stop bool))

Iterate over all ComplianceInfos.

func (Keeper) SetComplianceInfo

func (k Keeper) SetComplianceInfo(ctx sdk.Context, model types.ComplianceInfo)

Sets the entire ComplianceInfo metadata struct for a ComplianceInfoID.

type TestSetup

type TestSetup struct {
	Cdc               *codec.Codec
	Ctx               sdk.Context
	CompliancetKeeper Keeper
	Querier           sdk.Querier
}

func Setup

func Setup() TestSetup

Jump to

Keyboard shortcuts

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