Documentation
¶
Index ¶
- Constants
- Variables
- func CertificateKey(state types.Certificate_State, id types.CertID) ([]byte, error)
- func CertificateKeyLegacy(id types.CertID) []byte
- func MustCertificateKey(state types.Certificate_State, id types.CertID) []byte
- func ParseCertIDLegacy(prefix []byte, from []byte) (types.CertID, error)
- func ParseCertKey(from []byte) (types.Certificate_State, types.CertID, error)
- type Keeper
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
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
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 ParseCertKey ¶ added in v0.38.0
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
Click to show internal directories.
Click to hide internal directories.