keeper

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionPrefix          = collections.NewPrefix(0)
	IntentPrefix          = 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 added in v0.1.1

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

func (ActionKeeper) ActionsByAddress added in v0.1.1

func (ActionKeeper) Coll added in v0.1.1

func (ActionKeeper) Get added in v0.1.1

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

func (ActionKeeper) New added in v0.1.1

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

func (ActionKeeper) Set added in v0.1.1

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

type ApproversEnv added in v0.1.1

type ApproversEnv []*types.Approver

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

func (ApproversEnv) Get added in v0.1.1

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.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	shieldExpanderFunc func() ast.Expander,
) Keeper

func (Keeper) ActionById

func (Keeper) Actions

func (Keeper) AddAction

func (k Keeper) AddAction(ctx sdk.Context, creator string, msg sdk.Msg, intent types.Intent, btl 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) CheckActionReady

func (k Keeper) CheckActionReady(ctx sdk.Context, act types.Action) (bool, error)

CheckActionReady checks if the intent attached to the action is satisfied. If the intent is satisfied, the action is marked as completed and true is returned, the actual execution of the action is left for the caller.

func (Keeper) ExecuteAction

func (k Keeper) ExecuteAction(ctx sdk.Context, act *types.Action) error

ExecuteAction executes the action and stores the result in the database. The action will be modified in place, setting the Result field. The updated action will also be persisted in the database.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetIntent

func (k Keeper) GetIntent(ctx sdk.Context, id uint64) (types.Intent, error)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) IntentById

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

func (Keeper) Intents

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) RegisterActionHandler

func (k Keeper) RegisterActionHandler(actionType string, handlerFn types.ActionHandler)

RegisterActionHandler registers a handler for a specific action type.

func (Keeper) SetParams

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

SetParams set the params

type Migrator added in v0.1.1

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

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

func NewMigrator added in v0.1.1

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.1.1

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

Jump to

Keyboard shortcuts

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