Documentation
¶
Index ¶
- Constants
- Variables
- func CertificateKey(state types.State, id types.CertID) ([]byte, error)
- func CertificateKeyLegacy(id types.CertID) []byte
- func MustCertificateKey(state types.State, id types.CertID) []byte
- func ParseCertID(prefix []byte, from []byte) (types.CertID, error)
- func ParseCertIDLegacy(prefix []byte, from []byte) (types.CertID, error)
- func ParseCertKey(from []byte) (types.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 ¶
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 ¶
CertificateKeyLegacy creates a store key of the format: prefix_bytes | owner_address_len (1 byte) | owner_address_bytes | 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
Click to show internal directories.
Click to hide internal directories.