keeper

package
v2.2.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CertStateValidPrefixID   = byte(0x01)
	CertStateRevokedPrefixID = byte(0x02)
)

Variables

View Source
var (
	CertPrefix             = []byte{0x11}
	CertStateValidPrefix   = []byte{CertStateValidPrefixID}
	CertStateRevokedPrefix = []byte{CertStateRevokedPrefixID}
)

Functions

func CertificateKey

func CertificateKey(state types.State, id types.CertID) ([]byte, error)

CertificateKey creates a store key of the format: prefix_bytes | state 1 byte | owner_address_len (1 byte) | owner_address_bytes | serial length (1 byte) | serial_bytes

func CertificateKeyLegacy

func CertificateKeyLegacy(id types.CertID) []byte

CertificateKeyLegacy creates a store key of the format: prefix_bytes | owner_address_len (1 byte) | owner_address_bytes | serial_bytes

func MustCertificateKey

func MustCertificateKey(state types.State, id types.CertID) []byte

func ParseCertID

func ParseCertID(prefix []byte, from []byte) (types.CertID, error)

func ParseCertIDLegacy

func ParseCertIDLegacy(prefix []byte, from []byte) (types.CertID, error)

func ParseCertKey

func ParseCertKey(from []byte) (types.State, types.CertID, error)

ParseCertKey parse certificate key into id format <0x11><state><add len><add bytes><serial length><serial bytes>

Types

type Keeper

type Keeper interface {
	Querier() types.QueryServer
	Codec() codec.BinaryCodec
	StoreKey() storetypes.StoreKey
	CreateCertificate(sdk.Context, sdk.Address, []byte, []byte) error
	RevokeCertificate(sdk.Context, types.CertID) error
	GetCertificateByID(ctx sdk.Context, id types.CertID) (types.CertificateResponse, bool)
	WithCertificates(ctx sdk.Context, fn func(id types.CertID, certificate types.CertificateResponse) bool)
	WithOwner(ctx sdk.Context, id sdk.Address, fn func(types.CertificateResponse) bool)
	WithOwnerState(ctx sdk.Context, id sdk.Address, state types.State, fn func(types.CertificateResponse) bool)
}

Keeper of the provider store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey storetypes.StoreKey) Keeper

NewKeeper creates and returns an instance for Market keeper

Jump to

Keyboard shortcuts

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