keeper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

nolint:deadcode unused DONTCOVER

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

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

Keeper of the msgauth store

func NewKeeper

func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, router sdk.Router, allowedMsgTypes ...string) Keeper

NewKeeper constructs a message authorisation Keeper

func (Keeper) DequeueAllMatureGrantQueue

func (k Keeper) DequeueAllMatureGrantQueue(ctx sdk.Context) (matureGrants []types.GGMPair)

DequeueAllMatureGrantQueue returns a concatenated list of all the timeslices inclusively previous to current block time, and deletes the timeslices from the queue

func (Keeper) DispatchActions

func (k Keeper) DispatchActions(ctx sdk.Context, granteeAddr sdk.AccAddress, msgs []sdk.Msg) error

DispatchActions attempts to execute the provided messages via authorization grants from the message signer to the grantee.

func (Keeper) GetGrant

func (k Keeper) GetGrant(ctx sdk.Context, granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, msgType string) (grant types.AuthorizationGrant, found bool)

GetGrant returns grant between granter and grantee for the given msg type

func (Keeper) GetGrantQueueTimeSlice

func (k Keeper) GetGrantQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (ggmPairs []types.GGMPair)

GetGrantQueueTimeSlice gets a specific grant queue timeslice. A timeslice is a slice of GGMPair corresponding to grants that expire at a certain time.

func (Keeper) GetGrants

func (k Keeper) GetGrants(ctx sdk.Context, granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress) (grants []types.AuthorizationGrant)

GetGrants returns all the grants between granter and grantee

func (Keeper) GrantQueueIterator

func (k Keeper) GrantQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

GrantQueueIterator returns all the grant queue timeslices from time 0 until endTime

func (Keeper) InsertGrantQueue

func (k Keeper) InsertGrantQueue(ctx sdk.Context, granterAddr,
	granteeAddr sdk.AccAddress, msgType string, completionTime time.Time)

InsertGrantQueue inserts an grant to the appropriate timeslice in the grant queue

func (Keeper) IsGrantable

func (k Keeper) IsGrantable(msgType string) bool

IsGrantable returns the flag that the given msg type is grantable or not

func (Keeper) IterateGrants

func (k Keeper) IterateGrants(ctx sdk.Context,
	handler func(granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, grant types.AuthorizationGrant) bool)

IterateGrants iterates over all authorization grants

func (Keeper) RevokeFromGrantQueue

func (k Keeper) RevokeFromGrantQueue(ctx sdk.Context, granterAddr,
	granteeAddr sdk.AccAddress, msgType string, completionTime time.Time)

RevokeFromGrantQueue removes grant data from the timeslice queue

func (Keeper) RevokeGrant

func (k Keeper) RevokeGrant(ctx sdk.Context, granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, msgType string)

RevokeGrant removes method revokes any authorization for the provided message type granted to the grantee by the granter.

func (Keeper) SetGrant

func (k Keeper) SetGrant(ctx sdk.Context, granterAddr sdk.AccAddress, granteeAddr sdk.AccAddress, grant types.AuthorizationGrant)

SetGrant method grants the provided authorization to the grantee on the granter's account with the provided expiration time. If there is an existing authorization grant for the same `sdk.Msg` type, this grant overwrites that.

func (Keeper) SetGrantQueueTimeSlice

func (k Keeper) SetGrantQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.GGMPair)

SetGrantQueueTimeSlice sets a specific grant queue timeslice.

Jump to

Keyboard shortcuts

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