restricting

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RestrictingKeyPrefix    = []byte("RestrictInfo")
	RestrictRecordKeyPrefix = []byte("RestrictRecord")
	EpochPrefix             = []byte("RestrictEpoch")
)

Functions

func GetLatestEpochKey

func GetLatestEpochKey() []byte

func GetReleaseAccountKey

func GetReleaseAccountKey(epoch uint64, index uint32) []byte

ReleaseAccountKey used for search the index of the restricting account in the released account list at target epoch. key: prefix + epoch + index

func GetReleaseAmountKey

func GetReleaseAmountKey(epoch uint64, account common.Address) []byte

RestrictingKey used for search restricting entry info. key: prefix + epoch + account

func GetReleaseEpochKey

func GetReleaseEpochKey(epoch uint64) []byte

ReleaseNumberKey used for search records at target epoch. key: prefix + epoch

func GetRestrictingKey

func GetRestrictingKey(account common.Address) []byte

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

type Result

type Result struct {
	Balance *hexutil.Big        `json:"balance"`
	Debt    *hexutil.Big        `json:"debt"`
	Entry   []ReleaseAmountInfo `json:"plans"`
	Pledge  *hexutil.Big        `json:"Pledge"`
}

for plugin test

Jump to

Keyboard shortcuts

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