keeper

package
v0.3.0-dev-6-2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

Handle all "track" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

Types

type Keeper

type Keeper struct {
	Sk supply.Keeper // Cosmos-SDK Supply Keeper
	// 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.Codec, key sdk.StoreKey, codespace sdk.CodespaceType, stakingKeeper staking.Keeper, ak auth.AccountKeeper, sk supply.Keeper, paramSpace params.Subspace) Keeper

NewKeeper returns an track keeper.

func (Keeper) AddDeposit

func (keeper Keeper) AddDeposit(ctx sdk.Context, trackID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (sdk.Error, bool)

func (Keeper) CreateTrack

func (keeper Keeper) CreateTrack(ctx sdk.Context, title, audio, image, duration string, hidden, explicit bool, genre, mood, artists, featuring, producers, description, copyright string, owner sdk.AccAddress) (types.Track, sdk.Error)

CreateTrack create new track

func (Keeper) DeleteAllPlays

func (keeper Keeper) DeleteAllPlays(ctx sdk.Context)

func (Keeper) DeleteAllShares

func (keeper Keeper) DeleteAllShares(ctx sdk.Context)

func (Keeper) DeleteDeposits

func (keeper Keeper) DeleteDeposits(ctx sdk.Context, trackID uint64)

DeleteDeposits deletes all the deposits on a specific artist without refunding them

func (Keeper) GetAccPower

func (keeper Keeper) GetAccPower(ctx sdk.Context, address sdk.AccAddress) sdk.Dec

GetAccPower, get account power based on staking

func (Keeper) GetAllDeposits

func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits types.Deposits)

GetAllDeposits returns all the deposits from the store

func (Keeper) GetAllShares

func (keeper Keeper) GetAllShares(ctx sdk.Context) (shares types.Shares)

func (Keeper) GetDeposit

func (keeper Keeper) GetDeposit(ctx sdk.Context, trackID uint64, depositorAddr sdk.AccAddress) (deposit types.Deposit, found bool)

GetDeposit gets the deposit of a specific depositor on a specific artist

func (Keeper) GetDepositParams

func (keeper Keeper) GetDepositParams(ctx sdk.Context) types.DepositParams

GetDepositParams returns the current DepositParams from the global param store

func (Keeper) GetDeposits

func (keeper Keeper) GetDeposits(ctx sdk.Context, trackID uint64) (deposits types.Deposits)

GetDeposits returns all the deposits from a specific artist

func (Keeper) GetDepositsIterator

func (keeper Keeper) GetDepositsIterator(ctx sdk.Context, trackID uint64) sdk.Iterator

GetDepositsIterator gets all the deposits on a specific proposal as an sdk.Iterator

func (Keeper) GetPlay

func (keeper Keeper) GetPlay(ctx sdk.Context, trackID uint64, accAddr sdk.AccAddress) (play types.Play, found bool)

func (Keeper) GetPlays

func (keeper Keeper) GetPlays(ctx sdk.Context, trackID uint64) (plays types.Plays)

func (Keeper) GetPlaysIterator

func (keeper Keeper) GetPlaysIterator(ctx sdk.Context, trackID uint64) sdk.Iterator

func (Keeper) GetShare

func (keeper Keeper) GetShare(ctx sdk.Context, trackID uint64) (share types.Share, found bool)

func (Keeper) GetTrack

func (keeper Keeper) GetTrack(ctx sdk.Context, trackID uint64) (track types.Track, ok bool)

GetTrack get Track from store by TrackID

func (Keeper) GetTrackID

func (keeper Keeper) GetTrackID(ctx sdk.Context) (trackID uint64, err sdk.Error)

GetTrackID gets the highest track ID

func (Keeper) GetTracksFiltered

func (keeper Keeper) GetTracksFiltered(ctx sdk.Context, ownerAddr sdk.AccAddress, status types.TrackStatus, numLatest uint64) []types.Track

GetTracksFiltered get Tracks from store by TrackID status will filter tracks by status numLatest will fetch a specified number of the most recent tracks, or 0 for all tracks

func (Keeper) IncrementShare

func (keeper Keeper) IncrementShare(ctx sdk.Context, trackID uint64, amt sdk.Dec) sdk.Error

func (Keeper) IterateAllDeposits

func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))

func (Keeper) IterateAllPlays

func (keeper Keeper) IterateAllPlays(ctx sdk.Context, cb func(play types.Play) (stop bool))

IterateAllPlays iterates over the all the stored plays and performs a callback function

func (Keeper) IterateAllShares

func (keeper Keeper) IterateAllShares(ctx sdk.Context, cb func(share types.Share) (stop bool))

func (Keeper) IterateDeposits

func (keeper Keeper) IterateDeposits(ctx sdk.Context, trackID uint64, cb func(deposit types.Deposit) (stop bool))

func (Keeper) IteratePlays

func (keeper Keeper) IteratePlays(ctx sdk.Context, trackID uint64, cb func(play types.Play) (stop bool))

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Play

func (keeper Keeper) Play(ctx sdk.Context, trackID uint64, accAddr sdk.AccAddress) sdk.Error

Play Add a play on a specific track

func (Keeper) RefundDeposits

func (keeper Keeper) RefundDeposits(ctx sdk.Context, trackID uint64)

RefundDeposits refunds and deletes all the deposits on a specific track

func (Keeper) SetDeposit

func (keeper Keeper) SetDeposit(ctx sdk.Context, trackID uint64, depositorAddr sdk.AccAddress, deposit types.Deposit)

func (Keeper) SetDepositParams

func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams types.DepositParams)

func (Keeper) SetTrack

func (keeper Keeper) SetTrack(ctx sdk.Context, track types.Track)

SetTrack set an track to store

func (Keeper) SetTrackID

func (keeper Keeper) SetTrackID(ctx sdk.Context, trackID uint64)

Set the track ID

func (Keeper) SetTrackStatus

func (keeper Keeper) SetTrackStatus(ctx sdk.Context, trackID uint64, status types.TrackStatus) sdk.Error

SetTrackStatus set Status of the Track {Nil, Verified, Rejected, Failed}

Jump to

Keyboard shortcuts

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