reward

package
v0.0.0-...-4701ab3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: LGPL-3.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPowerSumKey

func FromPowerSumKey(bs []byte) (common.Address, bool)

Types

type Rewarder

type Rewarder interface {
	ProcessReward(Formulator common.Address, ctx *data.Context) ([]byte, error)
	ApplyGenesis(ctx *data.ContextData) ([]byte, error)
	LoadFromSaveData([]byte) error
}

Rewarder procceses rewards of the target height

type TestNetRewarder

type TestNetRewarder struct {
	LastPaidHeight  uint32
	PowerMap        map[common.Address]*amount.Amount
	StakingPowerMap map[common.Address]map[common.Address]*amount.Amount
}

func NewTestNetRewarder

func NewTestNetRewarder() *TestNetRewarder

func (*TestNetRewarder) ApplyGenesis

func (rd *TestNetRewarder) ApplyGenesis(ctx *data.ContextData) ([]byte, error)

ApplyGenesis init genesis data

func (*TestNetRewarder) LoadFromSaveData

func (rd *TestNetRewarder) LoadFromSaveData(SaveData []byte) error

LoadFromSaveData recover the status using the save data

func (*TestNetRewarder) ProcessReward

func (rd *TestNetRewarder) ProcessReward(addr common.Address, ctx *data.Context) ([]byte, error)

ProcessReward gives a reward to the block generator address

Jump to

Keyboard shortcuts

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