keeper

package
v0.0.0-...-4fa03f3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 8 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 {
	Cdc *codec.Codec
	// contains filtered or unexported fields
}

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

func (k *Keeper) AddRep(ctx sdk.Context, attendee *types.Attendee, points uint) sdk.Error

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

func (k *Keeper) AwardScanPoints(ctx sdk.Context, scan *types.Scan) sdk.Error

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

func (k Keeper) ClearBonus(ctx sdk.Context)

ClearBonus - nolint

func (Keeper) CoinKeeper

func (k Keeper) CoinKeeper() bank.Keeper

CoinKeeper returns the module's bank keeper nolint: gocritic

func (Keeper) Delete

func (k Keeper) Delete(ctx sdk.Context, key []byte)

Delete removes the provided key value pair from the store

func (Keeper) Get

func (k Keeper) Get(ctx sdk.Context, key []byte) (v []byte, err sdk.Error)

Get returns the value for the provided key from the store

func (*Keeper) GetAllAttendees

func (k *Keeper) GetAllAttendees(ctx sdk.Context) (attendees []types.Attendee)

GetAllAttendees fetches all the attendees from the kvStore and returns them

func (*Keeper) GetAllScans

func (k *Keeper) GetAllScans(ctx sdk.Context) (scans []types.Scan)

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

func (k *Keeper) GetAttendeeWithID(ctx sdk.Context, id string) (types.Attendee, bool)

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

func (k Keeper) GetBonus(ctx sdk.Context) *types.Bonus

GetBonus - nolint

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

func (k Keeper) GetPrize(ctx sdk.Context, id []byte) (prize types.Prize, err sdk.Error)

GetPrize returns the prize by its id. Returns an error if it cannot find the prize with that id

func (Keeper) GetPrizes

func (k Keeper) GetPrizes(ctx sdk.Context) (types.GenesisPrizes, sdk.Error)

GetPrizes returns all the prizes

func (*Keeper) GetScanByID

func (k *Keeper) GetScanByID(ctx sdk.Context, id []byte) (scan *types.Scan, err sdk.Error)

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

func (k Keeper) Has(ctx sdk.Context, key []byte) bool

Has returns whether the key exists in the store

func (Keeper) HasLiveBonus

func (k Keeper) HasLiveBonus(ctx sdk.Context) bool

HasLiveBonus - nolint

func (*Keeper) IsBonusServiceAccount

func (k *Keeper) IsBonusServiceAccount(ctx sdk.Context, addr sdk.Address) bool

IsBonusServiceAccount returns true if the the account passed in is service address

func (*Keeper) IsClaimServiceAccount

func (k *Keeper) IsClaimServiceAccount(ctx sdk.Context, addr sdk.Address) bool

IsClaimServiceAccount returns true if the the account passed in is claim service address

func (*Keeper) IsServiceAccount

func (k *Keeper) IsServiceAccount(ctx sdk.Context, addr sdk.Address) bool

IsServiceAccount returns true if the the account passed in is service address

func (Keeper) KVStore

func (k Keeper) KVStore(ctx sdk.Context) sdk.KVStore

KVStore returns the key value store

func (*Keeper) RedeemPrizes

func (k *Keeper) RedeemPrizes(ctx sdk.Context, attendeeAddr sdk.AccAddress) sdk.Error

RedeemPrizes sets all of the prizes for an attendee to claimed = true

func (Keeper) Set

func (k Keeper) Set(ctx sdk.Context, key []byte, value []byte)

Set sets the key value pair in the store

func (*Keeper) SetAttendee

func (k *Keeper) SetAttendee(ctx sdk.Context, a *types.Attendee)

SetAttendee will set the attendee `a` to the store using it's AccAddress

func (Keeper) SetBonus

func (k Keeper) SetBonus(ctx sdk.Context, b types.Bonus)

SetBonus - nolint

func (*Keeper) SetBonusServiceAddress

func (k *Keeper) SetBonusServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error

SetBonusServiceAddress -

func (*Keeper) SetClaimServiceAddress

func (k *Keeper) SetClaimServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error

SetClaimServiceAddress sets the claim account for claiming prizes from the genesis file

func (Keeper) SetPrize

func (k Keeper) SetPrize(ctx sdk.Context, prize *types.Prize)

SetPrize puts the prize into the store with its tier turned into the is key

func (*Keeper) SetScan

func (k *Keeper) SetScan(ctx sdk.Context, scan *types.Scan)

SetScan puts the scan into the store with its id as key

func (*Keeper) SetServiceAddress

func (k *Keeper) SetServiceAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.Error

SetServiceAddress sets the service account from the genesis file

Jump to

Keyboard shortcuts

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