Documentation ¶
Index ¶
- Constants
- Variables
- func EmitEvent(k HasModuleName, ctx context.Context, name string, attrs ...sdk.Attribute)
- func IterAll[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler) ([][]byte, []T, error)
- func IterAllFnc[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler, fnc func([]byte, T) bool) error
- func IterAllRaw(store storetypes.KVStore, pu ProtoUnmarshaler) (keys [][]byte, values [][]byte, _err error)
- func Load[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler, key []byte) (T, error)
- func NewKvStoreWrapper[T proto.Message](s StoreGetterFn, ps ProtoSerializer) *kvStoreWrapper[T]
- func Save(store storetypes.KVStore, pm ProtoMarshaler, key []byte, val proto.Message) error
- func StoreFactory(storeKey corestore.KVStoreService, p string) func(ctx context.Context) storetypes.KVStore
- func Uint64ToByte(n uint64) []byte
- func ValAddressFromBech32(addressCodec address.Codec, valAddr string) ([]byte, error)
- type Byter
- type EventAttribute
- type HasModuleName
- type IDGenerator
- type KVStoreWrapper
- type KeeperUtil
- type KeeperUtilI
- type ProtoMarshaler
- type ProtoSerializer
- type ProtoUnmarshaler
- type StoreGetter
- type StoreGetterFn
Constants ¶
View Source
const ErrFailedToParseValAddress = liberr.Error("failed to parse validator address from bech32: %s")
View Source
const (
ErrNotFound = whoops.Errorf("item (%T) not found in store: %s")
)
Variables ¶
View Source
var ErrUnknownPanic = errors.New("unknown panic")
Functions ¶
func IterAll ¶
func IterAll[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler) ([][]byte, []T, error)
func IterAllFnc ¶
func IterAllFnc[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler, fnc func([]byte, T) bool) error
func IterAllRaw ¶
func IterAllRaw(store storetypes.KVStore, pu ProtoUnmarshaler) (keys [][]byte, values [][]byte, _err error)
func Load ¶
func Load[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler, key []byte) (T, error)
func NewKvStoreWrapper ¶
func NewKvStoreWrapper[T proto.Message](s StoreGetterFn, ps ProtoSerializer) *kvStoreWrapper[T]
func Save ¶
func Save(store storetypes.KVStore, pm ProtoMarshaler, key []byte, val proto.Message) error
func StoreFactory ¶
func StoreFactory(storeKey corestore.KVStoreService, p string) func(ctx context.Context) storetypes.KVStore
func Uint64ToByte ¶
Types ¶
type EventAttribute ¶
type EventAttribute string
type HasModuleName ¶
type HasModuleName interface {
ModuleName() string
}
func ModuleNameFunc ¶
func ModuleNameFunc(moduleName string) HasModuleName
type IDGenerator ¶
type IDGenerator struct {
// contains filtered or unexported fields
}
func NewIDGenerator ¶
func NewIDGenerator(sg StoreGetter, idkey []byte) IDGenerator
NewIDGenerator creates a new ID generator. IT uses idKey as a main
func (IDGenerator) GetLastID ¶
func (i IDGenerator) GetLastID(ctx context.Context, name string) uint64
getLastID returns the last id that was inserted for the given name. If one does not exist, then it returns 0,
func (IDGenerator) IncrementNextID ¶
func (i IDGenerator) IncrementNextID(ctx context.Context, name string) uint64
incrementNextID returns new ID which can now be used for referencing data and increments the counter internally. It returns the newly inserted ID.
func (IDGenerator) Zero ¶
func (i IDGenerator) Zero() bool
type KVStoreWrapper ¶
type KeeperUtil ¶
type KeeperUtil[T codec.ProtoMarshaler] struct { Val T }
func (KeeperUtil[T]) Load ¶
func (ku KeeperUtil[T]) Load(store storetypes.KVStore, pu ProtoUnmarshaler, key []byte) (T, error)
func (KeeperUtil[T]) Save ¶
func (ku KeeperUtil[T]) Save(store storetypes.KVStore, pm ProtoMarshaler, key []byte, val codec.ProtoMarshaler) error
type KeeperUtilI ¶
type KeeperUtilI[T codec.ProtoMarshaler] interface { Save(store storetypes.KVStore, pm ProtoMarshaler, key []byte, val codec.ProtoMarshaler) error Load(store storetypes.KVStore, pu ProtoUnmarshaler, key []byte) (T, error) }
type ProtoSerializer ¶
type ProtoSerializer interface { ProtoMarshaler ProtoUnmarshaler }
type ProtoUnmarshaler ¶
type StoreGetter ¶
type StoreGetter interface {
Store(ctx context.Context) storetypes.KVStore
}
func SimpleStoreGetter ¶
func SimpleStoreGetter(s storetypes.KVStore) StoreGetter
type StoreGetterFn ¶
type StoreGetterFn func(ctx context.Context) storetypes.KVStore
func (StoreGetterFn) Store ¶
func (s StoreGetterFn) Store(ctx context.Context) storetypes.KVStore
Source Files ¶
Click to show internal directories.
Click to hide internal directories.