keeper

package
v0.0.0-...-739a9b5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) crs.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) crs.QueryServer

NewQueryServerImpl returns an implementation of the module QueryServer.

Types

type Keeper

type Keeper struct {

	// state management
	Schema     collections.Schema
	Params     collections.Item[crs.Params]
	DecisionID collections.Sequence
	Decisions  collections.Map[uint64, crs.Decision]                         // key: ID
	Commits    collections.Map[collections.Pair[uint64, []byte], crs.Commit] // key: (decision ID, voter)
	Reveals    collections.Map[collections.Pair[uint64, []byte], crs.Reveal] // key: (decision ID, voter)
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, bankKeeper expectedkeepers.BankKeeper, authority string) Keeper

NewKeeper creates a new Keeper instance

func (Keeper) CreateDecision

func (k Keeper) CreateDecision(ctx context.Context, decision crs.Decision) error

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx context.Context) error

EndBlocker goest through all expired decisions and refunds the participants if needed. It will also delete commits, as we don't need them anymore.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) (*crs.GenesisState, error)

ExportGenesis exports the module state to a genesis state.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *crs.GenesisState) error

InitGenesis initializes the module state from a genesis state.

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is a struct for handling in-place state migrations.

func NewMigrator

func NewMigrator(k Keeper) Migrator

NewMigrator returns Migrator instance for the state migration.

Jump to

Keyboard shortcuts

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