Documentation ¶
Index ¶
- Constants
- Variables
- func DelegateRewardPerKey(nodeID discover.NodeID, stakingNum, epoch uint64) []byte
- func DelegateRewardPerKeys(nodeID discover.NodeID, 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 ¶
func DelegateRewardPerKeys ¶
func GetHistoryIncreaseKey ¶
GetHistoryIncreaseKey used for search the balance of reward pool at last year
func HistoryBalancePrefix ¶
Types ¶
type DelegateRewardPer ¶
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 ¶
func NewDelegateRewardPer(epoch uint64, totalReward, totalDelegate *big.Int) *DelegateRewardPer
func (*DelegateRewardPer) CalDelegateReward ¶
func (d *DelegateRewardPer) CalDelegateReward(delegate *big.Int) *big.Int
type DelegateRewardPerList ¶
type DelegateRewardPerList struct { Pers []*DelegateRewardPer // contains filtered or unexported fields }
func NewDelegateRewardPerList ¶
func NewDelegateRewardPerList() *DelegateRewardPerList
func (*DelegateRewardPerList) AppendDelegateRewardPer ¶
func (d *DelegateRewardPerList) AppendDelegateRewardPer(per *DelegateRewardPer)
func (*DelegateRewardPerList) DecreaseTotalAmount ¶
func (d *DelegateRewardPerList) DecreaseTotalAmount(receipt []DelegateRewardReceipt) int
func (*DelegateRewardPerList) IsChange ¶
func (d *DelegateRewardPerList) IsChange() bool
func (*DelegateRewardPerList) ShouldDel ¶
func (d *DelegateRewardPerList) ShouldDel() bool
func (DelegateRewardPerList) String ¶
func (d DelegateRewardPerList) String() string
type DelegateRewardReceipt ¶
type NodeDelegateReward ¶
Click to show internal directories.
Click to hide internal directories.