keeper

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

The module level router for state queries (using the Legacy Amino Codec)

Types

type Handler

type Handler func(record types.Attribute) error

Handler is a name record handler function for use with IterateRecords.

type Keeper

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

Keeper defines the attribute module Keeper

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace,
	authKeeper types.AccountKeeper, nameKeeper types.NameKeeper,
) Keeper

NewKeeper returns an attribute keeper. It handles: - setting attributes against an account - removing attributes - scanning for existing attributes on an account

CONTRACT: the parameter Subspace must have the param key table already initialized

func (Keeper) Attribute

Attribute queries for a specific attribute

func (Keeper) Attributes

Attributes queries for all attributes on a specified account

func (Keeper) DeleteAttribute

func (k Keeper) DeleteAttribute(ctx sdk.Context, addr string, name string, value *[]byte, owner sdk.AccAddress) error

DeleteAttribute removes attributes under the given account from the state store.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)

ExportGenesis exports the current keeper state of the attribute module.

func (Keeper) GetAllAttributes

func (k Keeper) GetAllAttributes(ctx sdk.Context, addr string) ([]types.Attribute, error)

GetAllAttributes gets all attributes for an address.

func (Keeper) GetAttributes

func (k Keeper) GetAttributes(ctx sdk.Context, addr string, name string) ([]types.Attribute, error)

GetAttributes gets all attributes with the given name from an account.

func (Keeper) GetMaxValueLength

func (k Keeper) GetMaxValueLength(ctx sdk.Context) (maxValueLength uint32)

GetMaxValueLength returns the current distribution community tax (or default if unset)

func (Keeper) GetParams

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

GetParams returns the total set of account parameters.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)

InitGenesis creates the initial genesis state for the attribute module.

func (Keeper) IterateRecords

func (k Keeper) IterateRecords(ctx sdk.Context, prefix []byte, handle Handler) error

IterateRecords iterates over all the stored attribute records and passes them to a callback function.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Params

Params queries params of attribute module

func (Keeper) Scan

Scan queries for all attributes on a specied account that have a given suffix in their name

func (Keeper) SetAttribute

func (k Keeper) SetAttribute(
	ctx sdk.Context, attr types.Attribute, owner sdk.AccAddress,
) error

Stores an attribute under the given account. The attribute name must resolve to the given owner address.

func (Keeper) SetParams

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

SetParams sets the account parameters to the param space.

func (Keeper) UpdateAttribute added in v1.5.0

func (k Keeper) UpdateAttribute(ctx sdk.Context, originalAttribute types.Attribute, updateAttribute types.Attribute, owner sdk.AccAddress,
) error

Updates an attribute under the given account. The attribute name must resolve to the given owner address and value must resolve to an existing attribute.

type Migrator added in v1.7.0

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

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

func NewMigrator added in v1.7.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (*Migrator) Migrate1to2 added in v1.7.0

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

Migrate1to2 migrates from version 1 to 2 to convert attribute keys from 20 to 32 length

Jump to

Keyboard shortcuts

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