Documentation ¶
Index ¶
- Constants
- Variables
- func GetLatestEpochKey() []byte
- func GetReleaseAccountKey(epoch uint64, index uint32) []byte
- func GetReleaseAmountKey(epoch uint64, account common.Address) []byte
- func GetReleaseEpochKey(epoch uint64) []byte
- func GetRestrictingKey(account common.Address) []byte
- type ReleaseAmountInfo
- type RestrictingInfo
- type RestrictingPlan
- type Result
Constants ¶
View Source
const (
RestrictTxPlanSize = 36
)
Variables ¶
View Source
var ( RestrictingKeyPrefix = []byte("RestrictInfo") RestrictRecordKeyPrefix = []byte("RestrictRecord") EpochPrefix = []byte("RestrictEpoch") InitialFoundationRestricting = []byte("InitialFoundationRestricting") )
View Source
var ( ErrParamEpochInvalid = common.NewBizError(304001, "param epoch can't be zero") ErrCountRestrictPlansInvalid = common.NewBizError(304002, fmt.Sprintf("the number of the restricting plan can't be zero or more than %d", RestrictTxPlanSize)) ErrLockedAmountTooLess = common.NewBizError(304003, "total restricting amount need more than 1 LAT") ErrBalanceNotEnough = common.NewBizError(304004, "create plan,the sender balance is not enough in restrict") ErrAccountNotFound = common.NewBizError(304005, "account is not found on restricting contract") ErrSlashingTooMuch = common.NewBizError(304006, "slashing amount is larger than staking amount") ErrStakingAmountEmpty = common.NewBizError(304007, "staking amount is 0") ErrPledgeLockFundsAmountLessThanZero = common.NewBizError(304008, "pledge lock funds amount can't less than 0") ErrReturnLockFundsAmountLessThanZero = common.NewBizError(304009, "return lock funds amount can't less than 0") ErrSlashingAmountLessThanZero = common.NewBizError(304010, "slashing amount can't less than 0") ErrCreatePlanAmountLessThanZero = common.NewBizError(304011, "create plan each amount can't less than 0") ErrStakingAmountInvalid = common.NewBizError(304012, "staking return amount is wrong") ErrRestrictBalanceNotEnough = common.NewBizError(304013, "the user restricting balance is not enough for pledge lock funds") )
Functions ¶
func GetLatestEpochKey ¶
func GetLatestEpochKey() []byte
func GetReleaseAccountKey ¶
ReleaseAccountKey used for search the index of the restricting account in the released account list at target epoch. key: prefix + epoch + index
func GetReleaseAmountKey ¶
RestrictingKey used for search restricting entry info. key: prefix + epoch + account
func GetReleaseEpochKey ¶
ReleaseNumberKey used for search records at target epoch. key: prefix + epoch
func GetRestrictingKey ¶
RestrictingKey used for search restricting info. key: prefix + account
Types ¶
type ReleaseAmountInfo ¶
type ReleaseAmountInfo struct { Height uint64 `json:"blockNumber"` // blockNumber representation of the block number at the released epoch Amount *hexutil.Big `json:"amount"` // amount representation of the released amount }
for plugin test
type RestrictingInfo ¶
type RestrictingInfo struct { NeedRelease *big.Int StakingAmount *big.Int CachePlanAmount *big.Int //Balance *big.Int // Balance representation all locked amount //Debt *big.Int // Debt representation will released amount. //DebtSymbol bool // Debt is owed to release in the past while symbol is true, else Debt can be used instead of release ReleaseList []uint64 // ReleaseList representation which epoch will release restricting }
for genesis and plugin test
func (*RestrictingInfo) RemoveEpoch ¶
func (r *RestrictingInfo) RemoveEpoch(epoch uint64)
type RestrictingPlan ¶
type RestrictingPlan struct { Epoch uint64 `json:"epoch"` // epoch representation of the released epoch at the target blockNumber Amount *big.Int `json:"amount"` // amount representation of the released amount }
for contract, plugin test, byte util
Click to show internal directories.
Click to hide internal directories.