keeper

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

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 added in v0.38.0

func CertificateKey(state types.Certificate_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 added in v0.38.0

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 added in v0.38.0

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

func ParseCertIDLegacy added in v0.38.0

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

func ParseCertKey added in v0.38.0

func ParseCertKey(from []byte) (types.Certificate_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() sdk.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)
	WithCertificatesState(ctx sdk.Context, state types.Certificate_State, fn func(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.Certificate_State, fn func(types.CertificateResponse) bool)
}

Keeper of the provider store

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey sdk.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