keeper

package
v30.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionFilteredPaginate

func CollectionFilteredPaginate[K, V any, C query.Collection[K, V], T any](
	ctx context.Context,
	coll C,
	pageReq *query.PageRequest,
	predicateFunc func(key K, value V) (include bool, err error),
	transformFunc func(key K, value V) (T, error),
	opts ...func(opt *query.CollectionsPaginateOptions[K]),
) (results []T, pageRes *query.PageResponse, err error)

CollectionFilteredPaginate works in the same way as CollectionPaginate but allows to filter results using a predicateFunc. A nil predicateFunc means no filtering is applied and results are collected as is. TransformFunc is applied only to results which are in range of the pagination and allow to convert the result to a different type. NOTE: do not collect results using the values/keys passed to predicateFunc as they are not guaranteed to be in the pagination range requested.

func NewLegacyQueryServer

func NewLegacyQueryServer(k *KeeperWrapper) v1beta1.QueryServer

NewLegacyQueryServer returns an implementation of the v1beta1 legacy QueryServer interface.

func NewQueryServer

func NewQueryServer(k *KeeperWrapper) v1.QueryServer

Types

type KeeperWrapper

type KeeperWrapper struct {
	*govkeeper.Keeper
	// contains filtered or unexported fields
}

KeeperWrapper is a wrapper around the cosmos sdk gov module keeper

func NewKeeper

func NewKeeper(
	cdc codec.Codec, storeService corestoretypes.KVStoreService, authKeeper govtypes.AccountKeeper,
	bankKeeper govtypes.BankKeeper, stakingKeeper govtypes.StakingKeeper, distrKeeper govtypes.DistributionKeeper,
	router baseapp.MessageRouter, config govtypes.Config, authority string,
) KeeperWrapper

NewKeeper returns a new wrapped gov module keeper instance.

func (*KeeperWrapper) SetHooks

func (k *KeeperWrapper) SetHooks(gh govtypes.GovHooks) *KeeperWrapper

SetHooks sets the hooks for governance on the original keeper and returns the updated wrapped keeper.

Jump to

Keyboard shortcuts

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