Documentation ¶
Index ¶
- Constants
- func EndBlocker(ctx sdk.Context, req abci.RequestEndBlock, rm ReputationKeeper)
- func ErrAccountNotFound(author types.AccountKey) sdk.Error
- func ErrPostNotFound(permlink types.Permlink) sdk.Error
- func ErrQueryFailed() sdk.Error
- func NewQuerier(rm ReputationKeeper) sdk.Querier
- type ReputationKeeper
- type ReputationManager
- func (rep ReputationManager) DonateAt(ctx sdk.Context, username types.AccountKey, post types.Permlink, ...) (types.MiniDollar, sdk.Error)
- func (rep ReputationManager) ExportToFile(ctx sdk.Context, _ *codec.Codec, file string) error
- func (rep ReputationManager) GetCurrentRound(ctx sdk.Context) (int64, sdk.Error)
- func (rep ReputationManager) GetReputation(ctx sdk.Context, username types.AccountKey) (types.MiniDollar, sdk.Error)
- func (rep ReputationManager) ImportFromFile(ctx sdk.Context, _ *codec.Codec, file string) error
- func (rep ReputationManager) Update(ctx sdk.Context) sdk.Error
Constants ¶
const ( // ModuleKey is the name of the module ModuleName = "reputation" // RouterKey is the message route for gov RouterKey = ModuleName // QuerierRoute is the querier route for gov QuerierRoute = ModuleName QueryReputation = "rep" )
Variables ¶
This section is empty.
Functions ¶
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, req abci.RequestEndBlock, rm ReputationKeeper)
EndBlocker - called every end blocker, udpate new round
func ErrAccountNotFound ¶
func ErrAccountNotFound(author types.AccountKey) sdk.Error
ErrAccountNotFound - error when account is not found
func ErrPostNotFound ¶
ErrPostNotFound - error when post is not found
func ErrQueryFailed ¶ added in v0.2.0
ErrQueryFailed - error when query reputation store failed
func NewQuerier ¶ added in v0.2.0
func NewQuerier(rm ReputationKeeper) sdk.Querier
creates a querier for vote REST endpoints
Types ¶
type ReputationKeeper ¶ added in v0.3.0
type ReputationKeeper interface { // upon donation, record this donation and return the impact factor. DonateAt( ctx sdk.Context, username types.AccountKey, post types.Permlink, amount types.MiniDollar) (types.MiniDollar, sdk.Error) // get user's latest reputation, which is the largest impact factor a user can // make in a window. GetReputation(ctx sdk.Context, username types.AccountKey) (types.MiniDollar, sdk.Error) // update game status on block end. Update(ctx sdk.Context) sdk.Error // return the current round start time GetCurrentRound(ctx sdk.Context) (int64, sdk.Error) // import/export this module to files ExportToFile(ctx sdk.Context, cdc *codec.Codec, file string) error ImportFromFile(ctx sdk.Context, cdc *codec.Codec, file string) error }
func NewReputationManager ¶
func NewReputationManager(storeKey sdk.StoreKey, holder param.ParamHolder) ReputationKeeper
NewReputationManager - require holder for BestContentIndexN
type ReputationManager ¶
type ReputationManager struct {
// contains filtered or unexported fields
}
ReputationManager - adaptor for reputation math model and cosmos application.
func (ReputationManager) DonateAt ¶
func (rep ReputationManager) DonateAt(ctx sdk.Context, username types.AccountKey, post types.Permlink, amount types.MiniDollar) (types.MiniDollar, sdk.Error)
DonateAt - It's caller's responsibility that parameters are all correct, although we do have some checks.
func (ReputationManager) ExportToFile ¶ added in v0.2.2
ExportToFile state of reputation system.
func (ReputationManager) GetCurrentRound ¶
GetCurrentRound of now
func (ReputationManager) GetReputation ¶
func (rep ReputationManager) GetReputation(ctx sdk.Context, username types.AccountKey) (types.MiniDollar, sdk.Error)
GetRepution - return reputation of @p username, costomnerScore + freeScore.
func (ReputationManager) ImportFromFile ¶ added in v0.2.2
ImportFromFile state of reputation system. after update6's code is merged, V2 is the only version that will exist.