reward

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DelegateRewardPerLength = 1000

Variables

View Source
var (
	HistoryIncreasePrefix    = []byte("RewardHistory")
	LastYearEndBalancePrefix = []byte("RewardBalance")
	YearStartBlockNumberKey  = []byte("YearStartBlockNumberKey")
	YearStartTimeKey         = []byte("YearStartTimeKey")
	RemainingRewardKey       = []byte("RemainingRewardKey")
	NewBlockRewardKey        = []byte("NewBlockRewardKey")
	StakingRewardKey         = []byte("StakingRewardKey")
	ChainYearNumberKey       = []byte("ChainYearNumberKey")
)
View Source
var (
	ErrDelegationNotFound = common.NewBizError(305001, "Delegation info not found")
)

Functions

func DelegateRewardPerKey added in v0.7.6

func DelegateRewardPerKey(nodeID discover.NodeID, stakingNum, epoch uint64) []byte

func DelegateRewardPerKeys added in v0.7.6

func DelegateRewardPerKeys(nodeID discover.NodeID, stakingNum, fromEpoch, toEpoch uint64) [][]byte

func GetHistoryIncreaseKey

func GetHistoryIncreaseKey(year uint32) []byte

GetHistoryIncreaseKey used for search the balance of reward pool at last year

func HistoryBalancePrefix

func HistoryBalancePrefix(year uint32) []byte

Types

type DelegateRewardPer added in v0.7.6

type DelegateRewardPer struct {
	//this is the node total effective delegate  amount at this epoch,will Decrease when receive delegate reward
	Left  *big.Int
	Epoch uint64
	//this is the node total delegate reward per amount at this epoch
	Delegate *big.Int
	//this is the node total effective delegate  amount at this epoch
	Reward *big.Int
}

func NewDelegateRewardPer added in v0.7.6

func NewDelegateRewardPer(epoch uint64, totalReward, totalDelegate *big.Int) *DelegateRewardPer

func (*DelegateRewardPer) CalDelegateReward added in v1.0.0

func (d *DelegateRewardPer) CalDelegateReward(delegate *big.Int) *big.Int

type DelegateRewardPerList added in v0.7.6

type DelegateRewardPerList struct {
	Pers []*DelegateRewardPer
	// contains filtered or unexported fields
}

func NewDelegateRewardPerList added in v0.7.6

func NewDelegateRewardPerList() *DelegateRewardPerList

func (*DelegateRewardPerList) AppendDelegateRewardPer added in v0.7.6

func (d *DelegateRewardPerList) AppendDelegateRewardPer(per *DelegateRewardPer)

func (*DelegateRewardPerList) DecreaseTotalAmount added in v0.7.6

func (d *DelegateRewardPerList) DecreaseTotalAmount(receipt []DelegateRewardReceipt) int

func (*DelegateRewardPerList) IsChange added in v0.7.6

func (d *DelegateRewardPerList) IsChange() bool

func (*DelegateRewardPerList) ShouldDel added in v0.7.6

func (d *DelegateRewardPerList) ShouldDel() bool

func (DelegateRewardPerList) String added in v0.7.6

func (d DelegateRewardPerList) String() string

type DelegateRewardReceipt added in v0.7.6

type DelegateRewardReceipt struct {
	//this is the account  total effective delegate amount with the node  on this epoch
	Delegate *big.Int
	Epoch    uint64
}

type NodeDelegateReward added in v0.7.6

type NodeDelegateReward struct {
	NodeID     discover.NodeID `json:"nodeID"`
	StakingNum uint64          `json:"stakingNum"`
	Reward     *big.Int        `json:"reward" rlp:"nil"`
}

type NodeDelegateRewardPresenter added in v0.7.6

type NodeDelegateRewardPresenter struct {
	NodeID     discover.NodeID `json:"nodeID" `
	Reward     *hexutil.Big    `json:"reward" `
	StakingNum uint64          `json:"stakingNum"`
}

Jump to

Keyboard shortcuts

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