Documentation ¶
Index ¶
- Constants
- Variables
- func DelegateRewardPerKey(nodeID enode.IDv0, stakingNum, epoch uint64) []byte
- func DelegateRewardPerKeys(nodeID enode.IDv0, stakingNum, fromEpoch, toEpoch uint64) [][]byte
- func GetHistoryIncreaseKey(year uint32) []byte
- func HistoryBalancePrefix(year uint32) []byte
- type DelegateRewardPer
- type DelegateRewardPerList
- func (d *DelegateRewardPerList) AppendDelegateRewardPer(per *DelegateRewardPer)
- func (d *DelegateRewardPerList) DecreaseTotalAmount(receipt []DelegateRewardReceipt) int
- func (d *DelegateRewardPerList) IsChange() bool
- func (d *DelegateRewardPerList) ShouldDel() bool
- func (d DelegateRewardPerList) String() string
- type DelegateRewardReceipt
- type NodeDelegateReward
- type NodeDelegateRewardPresenter
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 DelegateRewardPerKeys ¶ added in v0.7.6
func GetHistoryIncreaseKey ¶
GetHistoryIncreaseKey used for search the balance of reward pool at last year
func HistoryBalancePrefix ¶
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 NodeDelegateReward ¶ added in v0.7.6
Click to show internal directories.
Click to hide internal directories.