keeper

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

func NewMsgServerImpl added in v0.15.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

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

NewQuerier is the module level router for state queries

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all posts invariants

func ValidProfileInvariant

func ValidProfileInvariant(k Keeper) sdk.Invariant

ValidProfileInvariant checks that all registered profiles have a non-empty dtag and a non-empty creator

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(
	cdc codec.BinaryMarshaler, storeKey sdk.StoreKey,
	paramSpace paramstypes.Subspace, relKeeper relationshipskeeper.Keeper,
) Keeper

NewKeeper creates new instances of the profiles Keeper. This k stores the profile data using two different associations:

  1. Address -> Profile This is used to easily retrieve the profile of a user based on an address
  2. DTag -> Address This is used to get the address of a user based on a DTag

func (Keeper) DTagTransfers added in v0.15.0

DTagTransfers implements the Query/DTagTransfers gRPC method

func (Keeper) DeleteAllDTagTransferRequests added in v0.12.0

func (k Keeper) DeleteAllDTagTransferRequests(ctx sdk.Context, user string)

DeleteAllDTagTransferRequests delete all the requests made to the given user

func (Keeper) DeleteDTagTransferRequest added in v0.13.0

func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient string) error

DeleteDTagTransferRequest deletes the transfer requests made from the sender towards the recipient

func (Keeper) ExportGenesis added in v0.15.0

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

ExportGenesis returns the GenesisState associated with the given context

func (Keeper) GetDTagRelatedAddress added in v0.15.0

func (k Keeper) GetDTagRelatedAddress(ctx sdk.Context, dtag string) (addr string)

GetDTagRelatedAddress returns the address associated to the given dtag or an empty string if it does not exists

func (Keeper) GetDTagTransferRequests added in v0.12.0

func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagTransferRequest)

GetDTagTransferRequests returns all the requests inside the given context

func (Keeper) GetDtagFromAddress

func (k Keeper) GetDtagFromAddress(ctx sdk.Context, addr string) (dtag string)

GetDtagFromAddress returns the dtag associated with the given address or an empty string if no dtag exists

func (Keeper) GetParams

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

GetParams returns the params from the store

func (Keeper) GetProfile

func (k Keeper) GetProfile(ctx sdk.Context, address string) (profile types.Profile, found bool)

GetProfile returns the profile corresponding to the given address inside the current context.

func (Keeper) GetProfiles

func (k Keeper) GetProfiles(ctx sdk.Context) []types.Profile

GetProfiles returns all the created profiles inside the current context.

func (Keeper) GetUserIncomingDTagTransferRequests added in v0.15.0

func (k Keeper) GetUserIncomingDTagTransferRequests(ctx sdk.Context, user string) []types.DTagTransferRequest

GetUserIncomingDTagTransferRequests returns all the request made to the given user inside the current context.

func (Keeper) InitGenesis added in v0.15.0

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.ValidatorUpdate

InitGenesis initializes the chain state based on the given GenesisState

func (Keeper) IsUserBlocked added in v0.14.0

func (k Keeper) IsUserBlocked(ctx sdk.Context, blocker, blocked string) bool

IsUserBlocked tells if the given blocker has blocked the given blocked user

func (Keeper) IterateProfiles

func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile types.Profile) (stop bool))

IterateProfiles iterates through the profiles set and performs the provided function

func (Keeper) Params added in v0.15.0

Params implements the Query/Params gRPC method

func (Keeper) Profile added in v0.15.0

Profiles implements the Query/Profiles gRPC method

func (Keeper) RemoveProfile added in v0.15.0

func (k Keeper) RemoveProfile(ctx sdk.Context, address string) error

RemoveProfile allows to delete a profile associated with the given address inside the current context. It assumes that the address-related profile exists.

func (Keeper) SaveDTagTransferRequest added in v0.12.0

func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTransferRequest) error

SaveDTagTransferRequest save the given request associating it to the request recipient. It returns an error if the same request already exists.

func (Keeper) SetParams

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

SetParams sets params on the store

func (Keeper) StoreProfile added in v0.15.0

func (k Keeper) StoreProfile(ctx sdk.Context, profile types.Profile) error

StoreProfile stores the given profile inside the current context. It assumes that the given profile has already been validated. It returns an error if a profile with the same dtag from a different creator already exists

func (Keeper) ValidateProfile added in v0.15.0

func (k Keeper) ValidateProfile(ctx sdk.Context, profile types.Profile) error

ValidateProfile checks if the given profile is valid according to the current profile's module params

type WrappedDTagOwner added in v0.15.0

type WrappedDTagOwner struct {
	// Address of the user owning a Dtag
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

DTagOwner represents the owner of a specific DTag

func NewWrappedDTagOwner added in v0.15.0

func NewWrappedDTagOwner(address string) WrappedDTagOwner

NewWrappedDTagOwner returns a DTagOwner instance wrapping the given address

func (*WrappedDTagOwner) Descriptor added in v0.15.0

func (*WrappedDTagOwner) Descriptor() ([]byte, []int)

func (*WrappedDTagOwner) Equal added in v0.15.0

func (this *WrappedDTagOwner) Equal(that interface{}) bool

func (*WrappedDTagOwner) GetAddress added in v0.15.0

func (m *WrappedDTagOwner) GetAddress() string

func (*WrappedDTagOwner) Marshal added in v0.15.0

func (m *WrappedDTagOwner) Marshal() (dAtA []byte, err error)

func (*WrappedDTagOwner) MarshalTo added in v0.15.0

func (m *WrappedDTagOwner) MarshalTo(dAtA []byte) (int, error)

func (*WrappedDTagOwner) MarshalToSizedBuffer added in v0.15.0

func (m *WrappedDTagOwner) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WrappedDTagOwner) ProtoMessage added in v0.15.0

func (*WrappedDTagOwner) ProtoMessage()

func (*WrappedDTagOwner) Reset added in v0.15.0

func (m *WrappedDTagOwner) Reset()

func (*WrappedDTagOwner) Size added in v0.15.0

func (m *WrappedDTagOwner) Size() (n int)

func (*WrappedDTagOwner) String added in v0.15.0

func (m *WrappedDTagOwner) String() string

func (*WrappedDTagOwner) Unmarshal added in v0.15.0

func (m *WrappedDTagOwner) Unmarshal(dAtA []byte) error

func (*WrappedDTagOwner) XXX_DiscardUnknown added in v0.15.0

func (m *WrappedDTagOwner) XXX_DiscardUnknown()

func (*WrappedDTagOwner) XXX_Marshal added in v0.15.0

func (m *WrappedDTagOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WrappedDTagOwner) XXX_Merge added in v0.15.0

func (m *WrappedDTagOwner) XXX_Merge(src proto.Message)

func (*WrappedDTagOwner) XXX_Size added in v0.15.0

func (m *WrappedDTagOwner) XXX_Size() int

func (*WrappedDTagOwner) XXX_Unmarshal added in v0.15.0

func (m *WrappedDTagOwner) XXX_Unmarshal(b []byte) error

type WrappedDTagTransferRequests added in v0.15.0

type WrappedDTagTransferRequests struct {
	Requests []types.DTagTransferRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests"`
}

DtagRequests contains the DTag transfer requests made towards a user

func NewWrappedDTagTransferRequests added in v0.15.0

func NewWrappedDTagTransferRequests(requests []types.DTagTransferRequest) WrappedDTagTransferRequests

NewWrappedDTagTransferRequests returns a DTagRequests instance wrapping the given requests

func (*WrappedDTagTransferRequests) Descriptor added in v0.15.0

func (*WrappedDTagTransferRequests) Descriptor() ([]byte, []int)

func (*WrappedDTagTransferRequests) Equal added in v0.15.0

func (this *WrappedDTagTransferRequests) Equal(that interface{}) bool

func (*WrappedDTagTransferRequests) GetRequests added in v0.15.0

func (*WrappedDTagTransferRequests) Marshal added in v0.15.0

func (m *WrappedDTagTransferRequests) Marshal() (dAtA []byte, err error)

func (*WrappedDTagTransferRequests) MarshalTo added in v0.15.0

func (m *WrappedDTagTransferRequests) MarshalTo(dAtA []byte) (int, error)

func (*WrappedDTagTransferRequests) MarshalToSizedBuffer added in v0.15.0

func (m *WrappedDTagTransferRequests) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WrappedDTagTransferRequests) ProtoMessage added in v0.15.0

func (*WrappedDTagTransferRequests) ProtoMessage()

func (*WrappedDTagTransferRequests) Reset added in v0.15.0

func (m *WrappedDTagTransferRequests) Reset()

func (*WrappedDTagTransferRequests) Size added in v0.15.0

func (m *WrappedDTagTransferRequests) Size() (n int)

func (*WrappedDTagTransferRequests) String added in v0.15.0

func (m *WrappedDTagTransferRequests) String() string

func (*WrappedDTagTransferRequests) Unmarshal added in v0.15.0

func (m *WrappedDTagTransferRequests) Unmarshal(dAtA []byte) error

func (*WrappedDTagTransferRequests) XXX_DiscardUnknown added in v0.15.0

func (m *WrappedDTagTransferRequests) XXX_DiscardUnknown()

func (*WrappedDTagTransferRequests) XXX_Marshal added in v0.15.0

func (m *WrappedDTagTransferRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WrappedDTagTransferRequests) XXX_Merge added in v0.15.0

func (m *WrappedDTagTransferRequests) XXX_Merge(src proto.Message)

func (*WrappedDTagTransferRequests) XXX_Size added in v0.15.0

func (m *WrappedDTagTransferRequests) XXX_Size() int

func (*WrappedDTagTransferRequests) XXX_Unmarshal added in v0.15.0

func (m *WrappedDTagTransferRequests) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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