keeper

package
v0.5.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionPrefix                   = collections.NewPrefix(0)
	TemplatePrefix                 = collections.NewPrefix(1)
	ActionByAddressPrefix          = collections.NewPrefix(2)
	PreviousPruneBlockHeightPrefix = collections.NewPrefix(3)
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewQueryServerImpl added in v0.5.2

func NewQueryServerImpl(keeper Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type ActionApprovedVotesEnv added in v0.5.0

type ActionApprovedVotesEnv []*types.ActionVote

ActionApprovedVotesEnv is an environment that resolves action positive votes addresses to true.

func (ActionApprovedVotesEnv) Get added in v0.5.0

func (votes ActionApprovedVotesEnv) Get(name string) (object.Object, bool)

Get implements positive action vote evaluator.Environment.

type ActionKeeper

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

func (ActionKeeper) ActionsByAddress

func (ActionKeeper) Coll

func (ActionKeeper) ExpiredActions added in v0.5.0

func (k ActionKeeper) ExpiredActions(ctx context.Context, blockTime time.Time, pendingTimeout, completedTimeout time.Duration) ([]types.Action, error)

func (ActionKeeper) Get

func (k ActionKeeper) Get(ctx context.Context, id uint64) (types.Action, error)

func (ActionKeeper) GetLatestPruneHeight added in v0.5.0

func (k ActionKeeper) GetLatestPruneHeight(ctx context.Context) (int64, error)

func (ActionKeeper) Import added in v0.4.1

func (k ActionKeeper) Import(ctx sdk.Context, actions []types.Action) error

func (ActionKeeper) New

func (k ActionKeeper) New(ctx context.Context, action *types.Action) (uint64, error)

func (ActionKeeper) Set

func (k ActionKeeper) Set(ctx context.Context, action types.Action) error

type ActionRejectedVotesEnv added in v0.5.0

type ActionRejectedVotesEnv []*types.ActionVote

ActionRejectedVotesEnv is an environment that resolves action negative votes addresses to true.

func (ActionRejectedVotesEnv) Get added in v0.5.0

func (votes ActionRejectedVotesEnv) Get(name string) (object.Object, bool)

Get implements negative action vote evaluator.Environment.

type Keeper

type Keeper struct {
	ActionKeeper ActionKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeService store.KVStoreService,
	logger log.Logger,
	router baseapp.MessageRouter,
	authority string,
	actModuleAddress string,
	shieldExpanderFunc func() ast.Expander,
	templatesRegistry *types.TemplatesRegistry,
) Keeper

func (Keeper) ActionById

func (Keeper) Actions

func (Keeper) AddAction

func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, timeoutHeight uint64, expectedApproveExpression *ast.Expression, expectedRejectExpression *ast.Expression) (*types.Action, error)

AddAction creates a new action. The action is created with the provided creator as the first approver. This function also tries to execute the action immediately if it's ready.

func (Keeper) EndBlocker added in v0.5.0

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

func (*Keeper) ExportState added in v0.4.1

func (k *Keeper) ExportState(ctx sdk.Context, genState *types.GenesisState) error

func (Keeper) GetActionCreator

func (k Keeper) GetActionCreator(ctx context.Context) string

GetActionCreator returns the original address of the creator of the Action. This function is intended to be used in the context of MsgHandlers being executed as part of an Action.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetModuleAddress

func (k Keeper) GetModuleAddress() string

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) GetTemplate added in v0.5.0

func (k Keeper) GetTemplate(ctx context.Context, id uint64) (types.Template, error)

func (*Keeper) ImportState added in v0.4.1

func (k *Keeper) ImportState(ctx sdk.Context, genState types.GenesisState) error

func (Keeper) IsValidTemplate added in v0.5.0

func (k Keeper) IsValidTemplate(ctx context.Context, id uint64) error

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, params types.Params) error

SetParams set the params

func (Keeper) SimulateTemplate added in v0.5.0

func (Keeper) TemplateById added in v0.5.0

nolint:stylecheck,st1003 revive:disable-next-line var-naming

func (Keeper) Templates added in v0.5.0

func (Keeper) TemplatesRegistry added in v0.5.0

func (k Keeper) TemplatesRegistry() *types.TemplatesRegistry

func (Keeper) TryExecuteVotedAction added in v0.5.0

func (k Keeper) TryExecuteVotedAction(ctx context.Context, act *types.Action) error

TryExecuteVotedAction checks if the action's expression is satisfied and stores the result in the database.

func (Keeper) TryRejectVotedAction added in v0.5.0

func (k Keeper) TryRejectVotedAction(ctx context.Context, act *types.Action) error

TryRejectVotedAction checks if the action's reject expression is satisfied and updates its status revoked.

Jump to

Keyboard shortcuts

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