Documentation ¶
Index ¶
- Constants
- func EndBlocker(ctx sdk.Context, req abci.RequestEndBlock, rm ReputationManager) (tags sdk.Tags)
- func ErrAccountNotFound(author types.AccountKey) sdk.Error
- func ErrPostNotFound(permlink types.Permlink) sdk.Error
- func ErrQueryFailed() sdk.Error
- func NewQuerier(rm ReputationManager) sdk.Querier
- type ReputationManager
- func (rep ReputationManager) DonateAt(ctx sdk.Context, username types.AccountKey, post types.Permlink, ...) (types.Coin, sdk.Error)
- func (rep ReputationManager) ExportToFile(ctx sdk.Context, file string) error
- func (rep ReputationManager) GetCurrentRound(ctx sdk.Context) (int64, sdk.Error)
- func (rep ReputationManager) GetReputation(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- func (rep ReputationManager) GetSumRep(ctx sdk.Context, post types.Permlink) (types.Coin, sdk.Error)
- func (rep ReputationManager) ImportFromFile(ctx sdk.Context, file string) error
- func (rep ReputationManager) OnStakeIn(ctx sdk.Context, username types.AccountKey, amount types.Coin)
- func (rep ReputationManager) OnStakeOut(ctx sdk.Context, username types.AccountKey, amount types.Coin)
- func (rep ReputationManager) ReportAt(ctx sdk.Context, username types.AccountKey, post types.Permlink) (types.Coin, sdk.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 ReputationManager) (tags sdk.Tags)
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 ReputationManager) sdk.Querier
creates a querier for vote REST endpoints
Types ¶
type ReputationManager ¶
type ReputationManager struct {
// contains filtered or unexported fields
}
ReputationManager - adaptor for reputation math model and cosmos application.
func NewReputationManager ¶
func NewReputationManager(key sdk.StoreKey, holder param.ParamHolder) ReputationManager
NewReputationManager - require holder for BestContentIndexN
func (ReputationManager) DonateAt ¶
func (rep ReputationManager) DonateAt(ctx sdk.Context, username types.AccountKey, post types.Permlink, coinDay types.Coin) (types.Coin, 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
func (rep ReputationManager) ExportToFile(ctx sdk.Context, file string) error
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.Coin, sdk.Error)
GetRepution - return reputation of @p username, costomnerScore + freeScore.
func (ReputationManager) GetSumRep ¶
func (rep ReputationManager) GetSumRep(ctx sdk.Context, post types.Permlink) (types.Coin, sdk.Error)
GetSumRep of @p post
func (ReputationManager) ImportFromFile ¶ added in v0.2.2
func (rep ReputationManager) ImportFromFile(ctx sdk.Context, file string) error
ImportFromFile state of reputation system.
func (ReputationManager) OnStakeIn ¶
func (rep ReputationManager) OnStakeIn(ctx sdk.Context, username types.AccountKey, amount types.Coin)
OnStakeIn - on @p username stakein @p amount.
func (ReputationManager) OnStakeOut ¶
func (rep ReputationManager) OnStakeOut(ctx sdk.Context, username types.AccountKey, amount types.Coin)
OnStakeOut - on @p username stakeout @p amount