reputation

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 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 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

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 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, file string) error
	ImportFromFile(ctx sdk.Context, 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

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.MiniDollar, sdk.Error)

GetRepution - return reputation of @p username, costomnerScore + freeScore.

func (ReputationManager) ImportFromFile added in v0.2.2

func (rep ReputationManager) ImportFromFile(ctx sdk.Context, file string) error

ImportFromFile state of reputation system. after update6's code is merged, V2 is the only version that will exist.

func (ReputationManager) Update

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

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

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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