Documentation ¶
Index ¶
- func EnsureModuleAccountAndAccountDataNameRecord(ctx sdk.Context, accountK types.AccountKeeper, nameK types.NameKeeper) (err error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Handler
- type Keeper
- func (k Keeper) AccountData(c context.Context, req *types.QueryAccountDataRequest) (*types.QueryAccountDataResponse, error)
- func (k Keeper) AccountsByAttribute(ctx sdk.Context, name string) (addresses []sdk.AccAddress, err error)
- func (k Keeper) Attribute(c context.Context, req *types.QueryAttributeRequest) (*types.QueryAttributeResponse, error)
- func (k Keeper) AttributeAccounts(c context.Context, req *types.QueryAttributeAccountsRequest) (*types.QueryAttributeAccountsResponse, error)
- func (k Keeper) Attributes(c context.Context, req *types.QueryAttributesRequest) (*types.QueryAttributesResponse, error)
- func (k Keeper) DecAttrNameAddressLookup(ctx sdk.Context, name string, addrBytes []byte)
- func (k Keeper) DeleteAttribute(ctx sdk.Context, addr string, name string, value *[]byte, owner sdk.AccAddress) error
- func (k Keeper) DeleteExpiredAttributes(ctx sdk.Context, limit int) int
- func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
- func (k Keeper) GetAccountData(ctx sdk.Context, addr string) (string, error)
- func (k Keeper) GetAllAttributes(ctx sdk.Context, addr string) ([]types.Attribute, error)
- func (k Keeper) GetAllAttributesAddr(ctx sdk.Context, addr []byte) ([]types.Attribute, error)
- func (k Keeper) GetAttributes(ctx sdk.Context, addr string, name string) ([]types.Attribute, error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetMaxValueLength(ctx sdk.Context) (maxValueLength uint32)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) IncAttrNameAddressLookup(ctx sdk.Context, name string, addrBytes []byte)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IsAuthority(addr string) bool
- func (k Keeper) IterateRecords(ctx sdk.Context, prefix []byte, handle Handler) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PurgeAttribute(ctx sdk.Context, name string, owner sdk.AccAddress) error
- func (k Keeper) Scan(c context.Context, req *types.QueryScanRequest) (*types.QueryScanResponse, error)
- func (k Keeper) SetAccountData(ctx sdk.Context, addr string, value string) error
- func (k Keeper) SetAttribute(ctx sdk.Context, attr types.Attribute, owner sdk.AccAddress) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpdateAttribute(ctx sdk.Context, originalAttribute types.Attribute, ...) error
- func (k Keeper) UpdateAttributeExpiration(ctx sdk.Context, updateAttribute types.Attribute, owner sdk.AccAddress) error
- func (k Keeper) ValidateAuthority(addr string) error
- func (k Keeper) ValidateExpirationDate(ctx sdk.Context, attr types.Attribute) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureModuleAccountAndAccountDataNameRecord ¶ added in v1.16.0
func EnsureModuleAccountAndAccountDataNameRecord(ctx sdk.Context, accountK types.AccountKeeper, nameK types.NameKeeper) (err error)
EnsureModuleAccountAndAccountDataNameRecord makes sure that the attribute module account exists and that the account data name record exists, is restricted, and owned by the attribute module. An error is returned if any of that cannot be made to be the way we want it.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the attribute MsgServer interface for the provided Keeper.
Types ¶
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, 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) AccountData ¶ added in v1.16.0
func (k Keeper) AccountData(c context.Context, req *types.QueryAccountDataRequest) (*types.QueryAccountDataResponse, error)
AccountData returns the accountdata for a specified account.
func (Keeper) AccountsByAttribute ¶ added in v1.15.0
func (k Keeper) AccountsByAttribute(ctx sdk.Context, name string) (addresses []sdk.AccAddress, err error)
AccountsByAttribute returns a list of sdk.AccAddress that have attribute name assigned
func (Keeper) Attribute ¶
func (k Keeper) Attribute(c context.Context, req *types.QueryAttributeRequest) (*types.QueryAttributeResponse, error)
Attribute queries for a specific attribute
func (Keeper) AttributeAccounts ¶ added in v1.15.0
func (k Keeper) AttributeAccounts(c context.Context, req *types.QueryAttributeAccountsRequest) (*types.QueryAttributeAccountsResponse, error)
AttributeAccounts queries for all accounts that have a specific attribute
func (Keeper) Attributes ¶
func (k Keeper) Attributes(c context.Context, req *types.QueryAttributesRequest) (*types.QueryAttributesResponse, error)
Attributes queries for all attributes on a specified account
func (Keeper) DecAttrNameAddressLookup ¶ added in v1.15.0
DecAttrNameAddressLookup decrements the name to account lookups and removes value if decremented to 0
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) DeleteExpiredAttributes ¶ added in v1.16.0
DeleteExpiredAttributes find and delete expired attributes returns the total deleted limit sets the max amount to delete in a call, 0 for not limit
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) GetAccountData ¶ added in v1.16.0
GetAccountData gets the value of the special accountdata attribute for the given address.
func (Keeper) GetAllAttributes ¶
GetAllAttributes gets all attributes for an address.
func (Keeper) GetAllAttributesAddr ¶ added in v1.16.0
GetAllAttributesAddr gets all attributes for an AccAddress or MetadataAddress.
func (Keeper) GetAttributes ¶
GetAttributes gets all attributes with the given name from an account.
func (Keeper) GetAuthority ¶ added in v1.19.0
GetAuthority is signer of the proposal
func (Keeper) GetMaxValueLength ¶
GetMaxValueLength returns the max value for attribute length.
func (Keeper) IncAttrNameAddressLookup ¶ added in v1.15.0
IncAttrNameAddressLookup increments the count of name to address lookups
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) IsAuthority ¶ added in v1.19.0
IsAuthority returns true if the provided address bech32 string is the authority address.
func (Keeper) IterateRecords ¶
IterateRecords iterates over all the stored attribute records and passes them to a callback function.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries params of attribute module
func (Keeper) PurgeAttribute ¶ added in v1.15.0
PurgeAttribute removes attributes under the given account from the state store.
func (Keeper) Scan ¶
func (k Keeper) Scan(c context.Context, req *types.QueryScanRequest) (*types.QueryScanResponse, error)
Scan queries all attributes associated with a specified account that contain a particular suffix in their name.
func (Keeper) SetAccountData ¶ added in v1.16.0
SetAccountData sets/updates/deletes the value of the special accountdata attribute for a given address. An error is only returned if the account data cannot be set as requested.
func (Keeper) SetAttribute ¶
SetAttribute stores an attribute under the given account. The attribute name must resolve to the given owner address.
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
UpdateAttribute 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.
func (Keeper) UpdateAttributeExpiration ¶ added in v1.16.0
func (k Keeper) UpdateAttributeExpiration(ctx sdk.Context, updateAttribute types.Attribute, owner sdk.AccAddress, ) error
UpdateAttributeExpiration updates the expiration date on an attribute.
func (Keeper) ValidateAuthority ¶ added in v1.19.0
ValidateAuthority returns an error if the provided address is not the authority.