keeper

package
v0.42.32 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc codec.BinaryMarshaler, router *baseapp.MsgServiceRouter) Keeper

NewKeeper constructs a message authorization Keeper

func (Keeper) Authorization

Authorization implements the Query/Authorization gRPC method.

func (Keeper) Authorizations

Authorizations implements the Query/Authorizations gRPC method.

func (Keeper) DispatchActions

func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, serviceMsgs []sdk.ServiceMsg) (*sdk.Result, error)

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

func (Keeper) ExecAuthorized

ExecAuthorized implements the MsgServer.ExecAuthorized method.

func (Keeper) GetAuthorizations

func (k Keeper) GetAuthorizations(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress) (authorizations []exported.Authorization)

GetAuthorizations Returns list of `Authorizations` granted to the grantee by the granter.

func (Keeper) GetOrRevokeAuthorization

func (k Keeper) GetOrRevokeAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) (cap exported.Authorization, expiration time.Time)

GetOrRevokeAuthorization Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. If the Authorization is expired already, it will revoke the authorization and return nil

func (Keeper) Grant

func (k Keeper) Grant(ctx sdk.Context, grantee, granter sdk.AccAddress, authorization exported.Authorization, expiration time.Time) error

Grant 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) GrantAuthorization

GrantAuthorization implements the MsgServer.GrantAuthorization method.

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) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) Revoke

func (k Keeper) Revoke(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) error

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

func (Keeper) RevokeAuthorization

RevokeAuthorization implements the MsgServer.RevokeAuthorization method.

Jump to

Keyboard shortcuts

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