reputation

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
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

func ErrPostNotFound(permlink types.Permlink) sdk.Error

ErrPostNotFound - error when post is not found

func ErrQueryFailed added in v0.2.0

func ErrQueryFailed() sdk.Error

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

func (rep ReputationManager) GetCurrentRound(ctx sdk.Context) (int64, sdk.Error)

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

func (ReputationManager) ReportAt

func (rep ReputationManager) ReportAt(ctx sdk.Context,
	username types.AccountKey, post types.Permlink) (types.Coin, sdk.Error)

ReportAt - @p username report @p post.

func (ReputationManager) Update

func (rep ReputationManager) Update(ctx sdk.Context) sdk.Error

Update - on blocker end, update reputation time related information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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