types

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Codespace sdk.CodespaceType = ModuleName

	CodeComplianceInfoDoesNotExist     sdk.CodeType = 301
	CodeInconsistentDates              sdk.CodeType = 302
	CodeAlreadyCertifyed               sdk.CodeType = 303
	CodeModelDoesNotExist              sdk.CodeType = 304
	CodeModelVersionStringDoesNotMatch sdk.CodeType = 305
)
View Source
const (
	// ModuleName is the name of the module.
	ModuleName = "compliance"

	// StoreKey to be used when creating the KVStore.
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName

Variables

View Source
var ComplianceInfoPrefix = []byte{0x01} // prefix for each key to a compliance info
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module.

Functions

func ErrAlreadyCertifyed

func ErrAlreadyCertifyed(vid interface{}, pid interface{}) sdk.Error

func ErrComplianceInfoDoesNotExist

func ErrComplianceInfoDoesNotExist(vid interface{}, pid interface{},
	softwareVersion interface{}, certificationType interface{}) sdk.Error

func ErrInconsistentDates

func ErrInconsistentDates(error interface{}) sdk.Error

func ErrModelDoesNotExist

func ErrModelDoesNotExist(vid interface{}, pid interface{}) sdk.Error

func ErrModelVersionStringDoesNotMatch

func ErrModelVersionStringDoesNotMatch(vid interface{}, pid interface{},
	softwareVersion interface{}, softwareVersionString interface{}) sdk.Error

func GetCertificationPrefix

func GetCertificationPrefix(certificationType CertificationType) []byte

Key builder for Compliance Info.

func GetComplianceInfoKey

func GetComplianceInfoKey(certificationType CertificationType, vid uint16,
	pid uint16, softwareVersion uint32) []byte

Key builder for Compliance Info.

func IsValidCertificationType

func IsValidCertificationType(certificationType CertificationType) bool

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete type on the Amino codec.

Types

type CertificationType

type CertificationType string
const (
	ZigbeeCertificationType CertificationType = "zigbee"
	MatterCertificationType CertificationType = "matter"
)

type CertificationTypes

type CertificationTypes []CertificationType

List of Certification Types

type ComplianceHistoryItem

type ComplianceHistoryItem struct {
	SoftwareVersionCertificationStatus SoftwareVersionCertificationStatus `json:"softwareVersionCertificationStatus"`
	Date                               time.Time                          `json:"date"` // rfc3339 encoded date
	Reason                             string                             `json:"reason,omitempty"`
}

Compliance info state changes

func NewComplianceHistoryItem

func NewComplianceHistoryItem(svCertificationStatus SoftwareVersionCertificationStatus,
	date time.Time, reason string) ComplianceHistoryItem

func (ComplianceHistoryItem) String

func (d ComplianceHistoryItem) String() string

type ComplianceInfo

type ComplianceInfo struct {
	VID                                uint16                             `json:"vid"`
	PID                                uint16                             `json:"pid"`
	SoftwareVersion                    uint32                             `json:"softwareVersion"`
	SoftwareVersionString              string                             `json:"softwareVersionString,omitempty"`
	CDVersionNumber                    uint32                             `json:"CDVersionNumber,omitempty"`
	SoftwareVersionCertificationStatus SoftwareVersionCertificationStatus `json:"softwareVersionCertificationStatus"`
	Date                               time.Time                          `json:"date"` // rfc3339 encoded date
	CertificationType                  CertificationType                  `json:"certification_type"`
	Reason                             string                             `json:"reason,omitempty"`
	Owner                              sdk.AccAddress                     `json:"owner"`
	History                            []ComplianceHistoryItem            `json:"history,omitempty"`
}

Compliance info stored into KVStore

func NewCertifiedComplianceInfo

func NewCertifiedComplianceInfo(vid uint16, pid uint16,
	softwareVersion uint32, softwareVersionString string,
	certificationType CertificationType,
	date time.Time, reason string, owner sdk.AccAddress) ComplianceInfo

func NewRevokedComplianceInfo

func NewRevokedComplianceInfo(vid uint16, pid uint16,
	softwareVersion uint32, softwareVersionString string,
	certificationType CertificationType,
	date time.Time, reason string, owner sdk.AccAddress) ComplianceInfo

func (ComplianceInfo) String

func (d ComplianceInfo) String() string

func (*ComplianceInfo) UpdateComplianceInfo

func (d *ComplianceInfo) UpdateComplianceInfo(date time.Time, reason string)

type ComplianceInfoInState

type ComplianceInfoInState struct {
	Value bool `json:"value"`
}

Response Payload for QueryCertifiedModel/QueryRevokedModel queries.

func (ComplianceInfoInState) String

func (n ComplianceInfoInState) String() string

type ComplianceInfoKey

type ComplianceInfoKey struct {
	VID               uint16            `json:"vid"`
	PID               uint16            `json:"pid"`
	SoftwareVersion   uint32            `json:"softwareVersion"`
	CertificationType CertificationType `json:"certification_type"`
}

type ComplianceState

type ComplianceState string
const (

	// Used for a SoftwareVersion when going into certification testing
	// (Note: these might or might not be placed in DCL, depending on CSA policy and procedures)
	Provisional ComplianceState = "provisional"
	Certified   ComplianceState = "certified"
	Revoked     ComplianceState = "revoked"
)

type ListComplianceInfoItems

type ListComplianceInfoItems struct {
	Total int              `json:"total"`
	Items []ComplianceInfo `json:"items"`
}

Response Payload for QueryAllComplianceInfoRecords query.

func (ListComplianceInfoItems) String

func (n ListComplianceInfoItems) String() string

Implement fmt.Stringer.

type ListComplianceInfoKeyItems

type ListComplianceInfoKeyItems struct {
	Total int                 `json:"total"`
	Items []ComplianceInfoKey `json:"items"`
}

Response Payload for QueryAllCertifiedModels/QueryAllRevokedModels queries.

func (ListComplianceInfoKeyItems) String

Implement fmt.Stringer.

type ListQueryParams

type ListQueryParams struct {
	CertificationType CertificationType
	Skip              int
	Take              int
}

Request Payload for QueryAllComplianceInfoRecords/QueryAllCertifiedModels/QueryAllRevokedModels (pagination and filtering) query.

func NewListQueryParams

func NewListQueryParams(certificationType CertificationType, skip int, take int) ListQueryParams

type MsgCertifyModel

type MsgCertifyModel struct {
	VID                   uint16            `json:"vid"`
	PID                   uint16            `json:"pid"`
	SoftwareVersion       uint32            `json:"softwareVersion"`
	SoftwareVersionString string            `json:"softwareVersionString"`
	CertificationDate     time.Time         `json:"certification_date"` // rfc3339 encoded date
	CertificationType     CertificationType `json:"certification_type"`
	Reason                string            `json:"reason,omitempty"`
	Provisional           bool              `json:"provisional,omitempty"`
	Signer                sdk.AccAddress    `json:"signer"`
}

func NewMsgCertifyModel

func NewMsgCertifyModel(vid uint16, pid uint16,
	softwareVersion uint32, softwareVersionString string,
	certificationDate time.Time, certificationType CertificationType,
	reason string, provisional bool, signer sdk.AccAddress) MsgCertifyModel

func (MsgCertifyModel) GetSignBytes

func (m MsgCertifyModel) GetSignBytes() []byte

func (MsgCertifyModel) GetSigners

func (m MsgCertifyModel) GetSigners() []sdk.AccAddress

func (MsgCertifyModel) Route

func (m MsgCertifyModel) Route() string

func (MsgCertifyModel) Type

func (m MsgCertifyModel) Type() string

func (MsgCertifyModel) ValidateBasic

func (m MsgCertifyModel) ValidateBasic() sdk.Error

type MsgRevokeModel

type MsgRevokeModel struct {
	VID                   uint16 `json:"vid"`
	PID                   uint16 `json:"pid"`
	SoftwareVersion       uint32 `json:"softwareVersion"`
	SoftwareVersionString string `json:"softwareVersionString"`

	RevocationDate    time.Time         `json:"revocation_date"` // rfc3339 encoded date
	CertificationType CertificationType `json:"certification_type"`
	Reason            string            `json:"reason,omitempty"`
	Signer            sdk.AccAddress    `json:"signer"`
}

func NewMsgRevokeModel

func NewMsgRevokeModel(vid uint16, pid uint16,
	softwareVersion uint32,
	revocationDate time.Time, certificationType CertificationType,
	revocationReason string, signer sdk.AccAddress) MsgRevokeModel

func (MsgRevokeModel) GetSignBytes

func (m MsgRevokeModel) GetSignBytes() []byte

func (MsgRevokeModel) GetSigners

func (m MsgRevokeModel) GetSigners() []sdk.AccAddress

func (MsgRevokeModel) Route

func (m MsgRevokeModel) Route() string

func (MsgRevokeModel) Type

func (m MsgRevokeModel) Type() string

func (MsgRevokeModel) ValidateBasic

func (m MsgRevokeModel) ValidateBasic() sdk.Error

type SoftwareVersionCertificationStatus

type SoftwareVersionCertificationStatus uint8
const (
	// CodeDevTest     SoftwareVersionCertificationStatus = 0
	CodeProvisional SoftwareVersionCertificationStatus = 1
	CodeCertified   SoftwareVersionCertificationStatus = 2
	CodeRevoked     SoftwareVersionCertificationStatus = 3
)

Jump to

Keyboard shortcuts

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