Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AccountKeeper() auth.AccountKeeper
- func (k *Keeper) AddRep(ctx sdk.Context, attendee *types.Attendee, points uint) sdk.Error
- func (k *Keeper) AddSharedID(ctx sdk.Context, senderAddr sdk.AccAddress, receiverAddr sdk.AccAddress, ...) sdk.Error
- func (k *Keeper) AwardScanPoints(ctx sdk.Context, scan *types.Scan) sdk.Error
- func (k *Keeper) AwardShareInfoPoints(ctx sdk.Context, scan *types.Scan, senderAddr sdk.AccAddress, ...) sdk.Error
- func (k Keeper) ClearBonus(ctx sdk.Context)
- func (k Keeper) CoinKeeper() bank.Keeper
- func (k Keeper) Delete(ctx sdk.Context, key []byte)
- func (k Keeper) Get(ctx sdk.Context, key []byte) (v []byte, err sdk.Error)
- func (k *Keeper) GetAllAttendees(ctx sdk.Context) (attendees []types.Attendee)
- func (k *Keeper) GetAllScans(ctx sdk.Context) (scans []types.Scan)
- func (k *Keeper) GetAttendee(ctx sdk.Context, address sdk.AccAddress) (attendee types.Attendee, exists bool)
- func (k *Keeper) GetAttendeeWithID(ctx sdk.Context, id string) (types.Attendee, bool)
- func (k *Keeper) GetAttendees(ctx sdk.Context, acc1 sdk.AccAddress, acc2 sdk.AccAddress) (a1 types.Attendee, a2 types.Attendee, err sdk.Error)
- func (k Keeper) GetBonus(ctx sdk.Context) *types.Bonus
- func (k *Keeper) GetBonusService(ctx sdk.Context) types.GenesisService
- func (k *Keeper) GetClaimService(ctx sdk.Context) types.GenesisService
- func (k Keeper) GetPrize(ctx sdk.Context, id []byte) (prize types.Prize, err sdk.Error)
- func (k Keeper) GetPrizes(ctx sdk.Context) (types.GenesisPrizes, sdk.Error)
- func (k *Keeper) GetScanByID(ctx sdk.Context, id []byte) (scan *types.Scan, err sdk.Error)
- func (k *Keeper) GetService(ctx sdk.Context) types.GenesisService
- func (k Keeper) Has(ctx sdk.Context, key []byte) bool
- func (k Keeper) HasLiveBonus(ctx sdk.Context) bool
- func (k *Keeper) IsBonusServiceAccount(ctx sdk.Context, addr sdk.Address) bool
- func (k *Keeper) IsClaimServiceAccount(ctx sdk.Context, addr sdk.Address) bool
- func (k *Keeper) IsServiceAccount(ctx sdk.Context, addr sdk.Address) bool
- func (k Keeper) KVStore(ctx sdk.Context) sdk.KVStore
- func (k *Keeper) RedeemPrizes(ctx sdk.Context, attendeeAddr sdk.AccAddress) sdk.Error
- func (k Keeper) Set(ctx sdk.Context, key []byte, value []byte)
- func (k *Keeper) SetAttendee(ctx sdk.Context, a *types.Attendee)
- func (k Keeper) SetBonus(ctx sdk.Context, b types.Bonus)
- func (k *Keeper) SetBonusServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error
- func (k *Keeper) SetClaimServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error
- func (k Keeper) SetPrize(ctx sdk.Context, prize *types.Prize)
- func (k *Keeper) SetScan(ctx sdk.Context, scan *types.Scan)
- func (k *Keeper) SetServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
Keeper maintains the link to data storage
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, longyStoreKey sdk.StoreKey, accKeeper auth.AccountKeeper, coinKeeper bank.Keeper) Keeper
NewKeeper is a creator for `Keeper`
func (Keeper) AccountKeeper ¶
func (k Keeper) AccountKeeper() auth.AccountKeeper
AccountKeeper returns the auth module's account keeper composed with this module nolint: gocritic
func (*Keeper) AddRep ¶
AddRep adds reputation to the attendee, and if that pushes them past a tier, then they will be rewarded a prize if there are any left for that tier level
func (*Keeper) AddSharedID ¶
func (k *Keeper) AddSharedID(ctx sdk.Context, senderAddr sdk.AccAddress, receiverAddr sdk.AccAddress, scanID []byte) sdk.Error
AddSharedID adds the scan id to the scan ids array of both the sender and receiver is they don't contain it yet
func (*Keeper) AwardScanPoints ¶
AwardScanPoints awards the points to each participant of the scan
func (*Keeper) AwardShareInfoPoints ¶
func (k *Keeper) AwardShareInfoPoints(ctx sdk.Context, scan *types.Scan, senderAddr sdk.AccAddress, receiverAddr sdk.AccAddress) sdk.Error
AwardShareInfoPoints adds points to the sender of the shared info based on if the receiver is a sponsor or not
func (Keeper) CoinKeeper ¶
CoinKeeper returns the module's bank keeper nolint: gocritic
func (*Keeper) GetAllAttendees ¶
GetAllAttendees fetches all the attendees from the kvStore and returns them
func (*Keeper) GetAllScans ¶
GetAllScans returns all of the scans from the keeper
func (*Keeper) GetAttendee ¶
func (k *Keeper) GetAttendee(ctx sdk.Context, address sdk.AccAddress) (attendee types.Attendee, exists bool)
GetAttendee will retrieve the attendee via `AccAddress`
func (*Keeper) GetAttendeeWithID ¶
GetAttendeeWithID will retrieve the attendee by `id`. The Address of an attendee is generated using the secp256k1 key using `id` as the secret. returns false if the attendee does not exist
func (*Keeper) GetAttendees ¶
func (k *Keeper) GetAttendees(ctx sdk.Context, acc1 sdk.AccAddress, acc2 sdk.AccAddress) (a1 types.Attendee, a2 types.Attendee, err sdk.Error)
GetAttendees returns the attendees for the give account addresses
func (*Keeper) GetBonusService ¶
func (k *Keeper) GetBonusService(ctx sdk.Context) types.GenesisService
GetBonusService retrieves the service account and returns it
func (*Keeper) GetClaimService ¶
func (k *Keeper) GetClaimService(ctx sdk.Context) types.GenesisService
GetClaimService retrieves the claim service account
func (Keeper) GetPrize ¶
GetPrize returns the prize by its id. Returns an error if it cannot find the prize with that id
func (*Keeper) GetScanByID ¶
GetScanByID returns the scan by its id. Returns an error if it cannot find the scan with that id
func (*Keeper) GetService ¶
func (k *Keeper) GetService(ctx sdk.Context) types.GenesisService
GetService retrieves the service account and returns it
func (Keeper) HasLiveBonus ¶
HasLiveBonus - nolint
func (*Keeper) IsBonusServiceAccount ¶
IsBonusServiceAccount returns true if the the account passed in is service address
func (*Keeper) IsClaimServiceAccount ¶
IsClaimServiceAccount returns true if the the account passed in is claim service address
func (*Keeper) IsServiceAccount ¶
IsServiceAccount returns true if the the account passed in is service address
func (*Keeper) RedeemPrizes ¶
RedeemPrizes sets all of the prizes for an attendee to claimed = true
func (*Keeper) SetAttendee ¶
SetAttendee will set the attendee `a` to the store using it's AccAddress
func (*Keeper) SetBonusServiceAddress ¶
SetBonusServiceAddress -
func (*Keeper) SetClaimServiceAddress ¶
SetClaimServiceAddress sets the claim account for claiming prizes from the genesis file
func (Keeper) SetPrize ¶
SetPrize puts the prize into the store with its tier turned into the is key
func (*Keeper) SetServiceAddress ¶
SetServiceAddress sets the service account from the genesis file