keeper

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionPrefix          = collections.NewPrefix(0)
	RulePrefix            = collections.NewPrefix(1)
	ActionByAddressPrefix = collections.NewPrefix(2)
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type ActionKeeper

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

func (ActionKeeper) ActionsByAddress

func (ActionKeeper) Coll

func (ActionKeeper) Get

func (k ActionKeeper) Get(ctx context.Context, id uint64) (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 ApproversEnv

type ApproversEnv []*types.Approver

ApproversEnv is an environment that resolves approvers' addresses to true.

func (ApproversEnv) Get

func (approvers ApproversEnv) Get(name string) (object.Object, bool)

Get implements 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,
	rulesRegistry *types.RulesRegistry,
) Keeper

func (Keeper) ActionById

func (Keeper) Actions

func (Keeper) AddAction

func (k Keeper) AddAction(ctx context.Context, creator string, msg sdk.Msg, timeoutHeight uint64) (*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) 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) GetRule

func (k Keeper) GetRule(ctx context.Context, id uint64) (types.Rule, error)

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) RuleById

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

func (Keeper) Rules

func (Keeper) RulesRegistry

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

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) TryExecuteAction

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

TryExecuteAction checks if the action's intent is satisfied and stores the result in the database.

type Migrator

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

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate2to3

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Jump to

Keyboard shortcuts

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