governance

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: LGPL-3.0 Imports: 21 Imported by: 21

Documentation

Overview

Governance contract: Users can apply for a candidate node to join consensus selection, deposit ONT to authorize for candidate nodes, quit selection and unAuthorize for candidate nodes through this contract. ONT deposited in the contract can get ONG bonus which come from transaction fee of the network.

Index

Constants

View Source
const (
	//function name
	INIT_CONFIG                      = "initConfig"
	REGISTER_CANDIDATE               = "registerCandidate"
	REGISTER_CANDIDATE_TRANSFER_FROM = "registerCandidateTransferFrom"
	UNREGISTER_CANDIDATE             = "unRegisterCandidate"
	AUTHORIZE_FOR_PEER               = "authorizeForPeer"
	AUTHORIZE_FOR_PEER_TRANSFER_FROM = "authorizeForPeerTransferFrom"
	UNAUTHORIZE_FOR_PEER             = "unAuthorizeForPeer"
	APPROVE_CANDIDATE                = "approveCandidate"
	REJECT_CANDIDATE                 = "rejectCandidate"
	BLACK_NODE                       = "blackNode"
	WHITE_NODE                       = "whiteNode"
	QUIT_NODE                        = "quitNode"
	WITHDRAW                         = "withdraw"
	WITHDRAW_ONG                     = "withdrawOng"
	WITHDRAW_FEE                     = "withdrawFee"
	COMMIT_DPOS                      = "commitDpos"
	UPDATE_CONFIG                    = "updateConfig"
	UPDATE_GLOBAL_PARAM              = "updateGlobalParam"
	UPDATE_GLOBAL_PARAM2             = "updateGlobalParam2"
	UPDATE_SPLIT_CURVE               = "updateSplitCurve"
	TRANSFER_PENALTY                 = "transferPenalty"
	CHANGE_MAX_AUTHORIZATION         = "changeMaxAuthorization"
	SET_PEER_COST                    = "setPeerCost"
	SET_FEE_PERCENTAGE               = "setFeePercentage"
	ADD_INIT_POS                     = "addInitPos"
	REDUCE_INIT_POS                  = "reduceInitPos"
	SET_PROMISE_POS                  = "setPromisePos"
	SET_GAS_ADDRESS                  = "setGasAddress"
	GET_PEER_POOL                    = "getPeerPool"
	GET_PEER_INFO                    = "getPeerInfo"
	GET_PEER_POOL_BY_ADDRESS         = "getPeerPoolByAddress"

	//key prefix
	GLOBAL_PARAM      = "globalParam"
	GLOBAL_PARAM2     = "globalParam2"
	VBFT_CONFIG       = "vbftConfig"
	GOVERNANCE_VIEW   = "governanceView"
	CANDIDITE_INDEX   = "candidateIndex"
	PEER_POOL         = "peerPool"
	PEER_INDEX        = "peerIndex"
	BLACK_LIST        = "blackList"
	TOTAL_STAKE       = "totalStake"
	PENALTY_STAKE     = "penaltyStake"
	SPLIT_CURVE       = "splitCurve"
	PEER_ATTRIBUTES   = "peerAttributes"
	SPLIT_FEE         = "splitFee"
	SPLIT_FEE_ADDRESS = "splitFeeAddress"
	PROMISE_POS       = "promisePos"
	PRE_CONFIG        = "preConfig"
	GAS_ADDRESS       = "gasAddress"

	//global
	PRECISE            = 1000000
	NEW_VERSION_VIEW   = 6
	NEW_VERSION_BLOCK  = 414100
	NEW_WITHDRAW_BLOCK = 2800000
)

Variables

View Source
var AUTHORIZE_INFO_POOL = []byte{118, 111, 116, 101, 73, 110, 102, 111, 80, 111, 111, 108}
View Source
var MIN_CANDIDATE_FEE = uint64(math.Pow(10, constants.ONG_DECIMALS))

candidate fee must >= 1 ONG

View Source
var Xi = []uint32{}/* 101 elements not displayed */

Functions

func AddInitPos added in v1.0.3

func AddInitPos(native *native.NativeService) ([]byte, error)

add init pos of a node

func ApproveCandidate

func ApproveCandidate(native *native.NativeService) ([]byte, error)

Deprecated Approve a registered candidate node Only approved candidate node can participate in consensus selection and get ong bonus.

func AuthorizeForPeer added in v1.0.2

func AuthorizeForPeer(native *native.NativeService) ([]byte, error)

Authorize for a node by depositing ONT in this governance contract, used by users

func AuthorizeForPeerTransferFrom added in v1.0.2

func AuthorizeForPeerTransferFrom(native *native.NativeService) ([]byte, error)

Authorize for a node by depositing ONT in this governance contract, used by contracts

func BlackNode

func BlackNode(native *native.NativeService) ([]byte, error)

Put a node into black list, remove node from pool Whole of initPos of black node will be punished, and several percent of authorize deposit will be punished too. Node in black list can't be registered.

func ChangeMaxAuthorization added in v1.0.3

func ChangeMaxAuthorization(native *native.NativeService) ([]byte, error)

Change the status if node can receive authorization from ont holders

func CheckVBFTConfig

func CheckVBFTConfig(configuration *config.VBFTConfig) error

func CommitDpos

func CommitDpos(native *native.NativeService) ([]byte, error)

Go to next consensus epoch

func GetBytesUint32

func GetBytesUint32(b []byte) (uint32, error)

func GetBytesUint64 added in v1.0.3

func GetBytesUint64(b []byte) (uint64, error)

func GetPeerInfo added in v1.11.0

func GetPeerInfo(native *native.NativeService) ([]byte, error)

func GetPeerPool added in v1.11.0

func GetPeerPool(native *native.NativeService) ([]byte, error)

func GetPeerPoolByAddress added in v1.11.0

func GetPeerPoolByAddress(native *native.NativeService) ([]byte, error)

func GetUint32Bytes

func GetUint32Bytes(num uint32) []byte

func GetUint64Bytes added in v1.0.3

func GetUint64Bytes(num uint64) []byte

func GetView

func GetView(native *native.NativeService, contract common.Address) (uint32, error)

func InitConfig

func InitConfig(native *native.NativeService) ([]byte, error)

Init governance contract, include vbft config, global param and ontid admin.

func InitGovernance

func InitGovernance()

Init governance contract address

func QuitNode

func QuitNode(native *native.NativeService) ([]byte, error)

Quit a registered node, used by node owner. Remove node from pool and unfreeze deposit next epoch(candidate node) / next next epoch(consensus node)

func ReduceInitPos added in v1.0.3

func ReduceInitPos(native *native.NativeService) ([]byte, error)

reduce init pos of a node

func RegisterCandidate

func RegisterCandidate(native *native.NativeService) ([]byte, error)

Register a candidate node, used by users. Users can register a candidate node with a authorized ontid. Candidate node can be authorized and become consensus node according to their pos. Candidate node can get ong bonus according to their pos.

func RegisterCandidateTransferFrom added in v1.0.0

func RegisterCandidateTransferFrom(native *native.NativeService) ([]byte, error)

Register a candidate node, used by contracts. Contracts can register a candidate node with a authorized ontid after approving ont to governance contract before invoke this function. Candidate node can be authorized and become consensus node according to their pos. Candidate node can get ong bonus according to their pos.

func RegisterGovernanceContract

func RegisterGovernanceContract(native *native.NativeService)

Register methods of governance contract

func RejectCandidate

func RejectCandidate(native *native.NativeService) ([]byte, error)

Reject a registered candidate node, remove node from pool and unfreeze deposit ont Only approved candidate node can participate in consensus selection and get ong bonus.

func SetFeePercentage added in v1.12.0

func SetFeePercentage(native *native.NativeService) ([]byte, error)

Set node cost, node can take some percentage of fee before split

func SetGasAddress added in v1.6.0

func SetGasAddress(native *native.NativeService) ([]byte, error)

set gas address to receive 50% of gas fee

func SetPeerCost added in v1.0.3

func SetPeerCost(native *native.NativeService) ([]byte, error)

Set node cost, node can take some percentage of fee before split

func SetPromisePos added in v1.0.3

func SetPromisePos(native *native.NativeService) ([]byte, error)

set promise pos of a node

func TransferPenalty

func TransferPenalty(native *native.NativeService) ([]byte, error)

Transfer all punished ONT of a black node to a certain address

func UnAuthorizeForPeer added in v1.0.2

func UnAuthorizeForPeer(native *native.NativeService) ([]byte, error)

UnAuthorize for a node by redeeming ONT from this governance contract

func UnRegisterCandidate

func UnRegisterCandidate(native *native.NativeService) ([]byte, error)

Deprecated Unregister a registered candidate node, will remove node from pool, and unfreeze deposit ont.

func UpdateConfig

func UpdateConfig(native *native.NativeService) ([]byte, error)

Update VBFT config

func UpdateGlobalParam

func UpdateGlobalParam(native *native.NativeService) ([]byte, error)

Update global params of this governance contract

func UpdateGlobalParam2 added in v1.0.3

func UpdateGlobalParam2(native *native.NativeService) ([]byte, error)

Update global params of this governance contract

func UpdateSplitCurve

func UpdateSplitCurve(native *native.NativeService) ([]byte, error)

Update split curve

func WhiteNode

func WhiteNode(native *native.NativeService) ([]byte, error)

Remove a node from black list, allow it to be registered

func Withdraw

func Withdraw(native *native.NativeService) ([]byte, error)

Withdraw unfreezed ONT deposited in this governance contract.

func WithdrawFee added in v1.0.3

func WithdrawFee(native *native.NativeService) ([]byte, error)

Withdraw split fee of address

func WithdrawOng added in v0.9.2

func WithdrawOng(native *native.NativeService) ([]byte, error)

Withdraw unbounded ONG according to deposit ONT in this governance contract

Types

type ApproveCandidateParam

type ApproveCandidateParam struct {
	PeerPubkey string
}

func (*ApproveCandidateParam) Deserialization added in v1.8.1

func (this *ApproveCandidateParam) Deserialization(source *common.ZeroCopySource) error

func (*ApproveCandidateParam) Serialization added in v1.8.1

func (this *ApproveCandidateParam) Serialization(sink *common.ZeroCopySink)

type AuthorizeForPeerParam added in v1.0.2

type AuthorizeForPeerParam struct {
	Address        common.Address
	PeerPubkeyList []string
	PosList        []uint32
}

func (*AuthorizeForPeerParam) Deserialization added in v1.8.1

func (this *AuthorizeForPeerParam) Deserialization(source *common.ZeroCopySource) error

func (*AuthorizeForPeerParam) Serialization added in v1.8.1

func (this *AuthorizeForPeerParam) Serialization(sink *common.ZeroCopySink) error

type AuthorizeInfo added in v1.0.2

type AuthorizeInfo struct {
	PeerPubkey           string
	Address              common.Address
	ConsensusPos         uint64 //pos deposit in consensus node
	CandidatePos         uint64 //pos deposit in candidate node
	NewPos               uint64 //deposit new pos to consensus or candidate node, it will be calculated in next epoch, you can withdrawal it at any time
	WithdrawConsensusPos uint64 //unAuthorized pos from consensus pos, frozen until next next epoch
	WithdrawCandidatePos uint64 //unAuthorized pos from candidate pos, frozen until next epoch
	WithdrawUnfreezePos  uint64 //unfrozen pos, can withdraw at any time
}

func (*AuthorizeInfo) Deserialization added in v1.8.1

func (this *AuthorizeInfo) Deserialization(source *common.ZeroCopySource) error

func (*AuthorizeInfo) Serialization added in v1.8.1

func (this *AuthorizeInfo) Serialization(sink *common.ZeroCopySink)

type BlackListItem

type BlackListItem struct {
	PeerPubkey string         //peerPubkey in black list
	Address    common.Address //the owner of this peer
	InitPos    uint64         //initPos of this peer
}

func (*BlackListItem) Deserialization added in v1.8.1

func (this *BlackListItem) Deserialization(source *common.ZeroCopySource) error

func (*BlackListItem) Serialization added in v1.8.1

func (this *BlackListItem) Serialization(sink *common.ZeroCopySink)

type BlackNodeParam

type BlackNodeParam struct {
	PeerPubkeyList []string
}

func (*BlackNodeParam) Deserialization added in v1.8.1

func (this *BlackNodeParam) Deserialization(source *common.ZeroCopySource) error

func (*BlackNodeParam) Serialization added in v1.8.1

func (this *BlackNodeParam) Serialization(sink *common.ZeroCopySink)

type CandidateSplitInfo

type CandidateSplitInfo struct {
	PeerPubkey string
	Address    common.Address
	InitPos    uint64
	Stake      uint64 //total stake, init pos + total pos
	S          uint64 //fee split weight of this peer
}

type ChangeInitPosParam added in v1.0.3

type ChangeInitPosParam struct {
	PeerPubkey string
	Address    common.Address
	Pos        uint32
}

func (*ChangeInitPosParam) Deserialization added in v1.8.1

func (this *ChangeInitPosParam) Deserialization(source *common.ZeroCopySource) error

func (*ChangeInitPosParam) Serialization added in v1.8.1

func (this *ChangeInitPosParam) Serialization(sink *common.ZeroCopySink)

type ChangeMaxAuthorizationParam added in v1.0.3

type ChangeMaxAuthorizationParam struct {
	PeerPubkey   string
	Address      common.Address
	MaxAuthorize uint32
}

func (*ChangeMaxAuthorizationParam) Deserialization added in v1.8.1

func (this *ChangeMaxAuthorizationParam) Deserialization(source *common.ZeroCopySource) error

func (*ChangeMaxAuthorizationParam) Serialization added in v1.8.1

func (this *ChangeMaxAuthorizationParam) Serialization(sink *common.ZeroCopySink)

type Configuration

type Configuration struct {
	N                    uint32
	C                    uint32
	K                    uint32
	L                    uint32
	BlockMsgDelay        uint32
	HashMsgDelay         uint32
	PeerHandshakeTimeout uint32
	MaxBlockChangeView   uint32
}

func (*Configuration) Deserialization added in v1.8.1

func (this *Configuration) Deserialization(source *common.ZeroCopySource) error

func (*Configuration) Serialization added in v1.8.1

func (this *Configuration) Serialization(sink *common.ZeroCopySink)

type GasAddress added in v1.6.0

type GasAddress struct {
	Address common.Address
}

func (*GasAddress) Deserialization added in v1.6.0

func (this *GasAddress) Deserialization(source *common.ZeroCopySource) error

func (*GasAddress) Serialization added in v1.6.0

func (this *GasAddress) Serialization(sink *common.ZeroCopySink)

type GlobalParam

type GlobalParam struct {
	CandidateFee uint64 //unit: 10^-9 ong
	MinInitStake uint32 //min init pos
	CandidateNum uint32 //num of candidate and consensus node
	PosLimit     uint32 //authorize pos limit is initPos*posLimit
	A            uint32 //fee split to all consensus node
	B            uint32 //fee split to all candidate node
	Yita         uint32 //split curve coefficient
	Penalty      uint32 //authorize pos penalty percentage
}

func (*GlobalParam) Deserialization added in v1.8.1

func (this *GlobalParam) Deserialization(source *common.ZeroCopySource) error

func (*GlobalParam) Serialization added in v1.8.1

func (this *GlobalParam) Serialization(sink *common.ZeroCopySink)

type GlobalParam2 added in v1.0.3

type GlobalParam2 struct {
	MinAuthorizePos      uint32 //min ONT of each authorization, 500 default
	CandidateFeeSplitNum uint32 //num of peer can receive motivation(include consensus and candidate)
	DappFee              uint32 //fee split to dapp bonus
	Field2               []byte //reserved field
	Field3               []byte //reserved field
	Field4               []byte //reserved field
	Field5               []byte //reserved field
	Field6               []byte //reserved field
}

func (*GlobalParam2) Deserialization added in v1.8.1

func (this *GlobalParam2) Deserialization(source *common.ZeroCopySource) error

func (*GlobalParam2) Serialization added in v1.8.1

func (this *GlobalParam2) Serialization(sink *common.ZeroCopySink) error

type GovernanceView

type GovernanceView struct {
	View   uint32
	Height uint32
	TxHash common.Uint256
}

func GetGovernanceView

func GetGovernanceView(native *native.NativeService, contract common.Address) (*GovernanceView, error)

func (*GovernanceView) Deserialize

func (this *GovernanceView) Deserialize(r io.Reader) error

func (*GovernanceView) Serialize

func (this *GovernanceView) Serialize(w io.Writer) error

type PeerAttributes added in v1.0.3

type PeerAttributes struct {
	PeerPubkey   string
	MaxAuthorize uint64 //max authorzie pos this peer can receive(number of ont), set by peer owner
	T2PeerCost   uint64 //candidate or consensus node doesn't share initpos income percent with authorize users, 100 means node will take all incomes, it will take effect in view T + 2
	T1PeerCost   uint64 //candidate or consensus node doesn't share initpos income percent with authorize users, 100 means node will take all incomes, it will take effect in view T + 1
	TPeerCost    uint64 //candidate or consensus node doesn't share initpos income percent with authorize users, 100 means node will take all incomes, it will take effect in view T
	T2StakeCost  uint64 //candidate or consensus node doesn't share stake income percent with authorize users, it will take effect in view T + 2, 101 means 0, 0 means null
	T1StakeCost  uint64 //candidate or consensus node doesn't share stake income percent with authorize users, it will take effect in view T + 1, 101 means 0, 0 means null
	TStakeCost   uint64 //candidate or consensus node doesn't share stake income percent with authorize users, it will take effect in view T, 101 means 0, 0 means null
	Field4       []byte //reserved field
}

func (*PeerAttributes) Deserialization added in v1.8.1

func (this *PeerAttributes) Deserialization(source *common.ZeroCopySource) error

func (*PeerAttributes) Serialization added in v1.8.1

func (this *PeerAttributes) Serialization(sink *common.ZeroCopySink)

type PeerPoolItem

type PeerPoolItem struct {
	Index      uint32         //peer index
	PeerPubkey string         //peer pubkey
	Address    common.Address //peer owner
	Status     Status         //peer status
	InitPos    uint64         //peer initPos
	TotalPos   uint64         //total authorize pos this peer received
}

func (*PeerPoolItem) Deserialization added in v1.8.1

func (this *PeerPoolItem) Deserialization(source *common.ZeroCopySource) error

func (*PeerPoolItem) Serialization added in v1.8.1

func (this *PeerPoolItem) Serialization(sink *common.ZeroCopySink)

type PeerPoolItemForVm added in v1.11.0

type PeerPoolItemForVm struct {
	Index       uint32         //peer index
	PeerAddress common.Address //peer address
	Address     common.Address //peer owner
	Status      Status         //peer status
	InitPos     uint64         //peer initPos
	TotalPos    uint64         //total authorize pos this peer received
}

readable for neovm, only used for GetPeerPool, GetPeerInfo and GetPeerPoolByAddress

func (*PeerPoolItemForVm) Serialization added in v1.11.0

func (this *PeerPoolItemForVm) Serialization(sink *common.ZeroCopySink)

type PeerPoolList

type PeerPoolList struct {
	Peers []*PeerPoolItem
}

type PeerPoolListForVm added in v1.11.0

type PeerPoolListForVm struct {
	PeerPoolList []*PeerPoolItemForVm
}

func GetPeerPoolForVm added in v1.11.0

func GetPeerPoolForVm(native *native.NativeService) (*PeerPoolListForVm, error)

func (*PeerPoolListForVm) Serialization added in v1.11.0

func (this *PeerPoolListForVm) Serialization(sink *common.ZeroCopySink)

type PeerPoolMap

type PeerPoolMap struct {
	PeerPoolMap map[string]*PeerPoolItem
}

func GetPeerPoolMap

func GetPeerPoolMap(native *native.NativeService, contract common.Address, view uint32) (*PeerPoolMap, error)

func (*PeerPoolMap) Deserialization added in v1.8.1

func (this *PeerPoolMap) Deserialization(source *common.ZeroCopySource) error

func (*PeerPoolMap) Serialization added in v1.8.1

func (this *PeerPoolMap) Serialization(sink *common.ZeroCopySink) error

type PeerStakeInfo

type PeerStakeInfo struct {
	Index      uint32
	PeerPubkey string
	Stake      uint64
}

type PenaltyStake

type PenaltyStake struct {
	PeerPubkey   string //peer pubKey of penalty stake
	InitPos      uint64 //initPos penalty
	AuthorizePos uint64 //authorize pos penalty
	TimeOffset   uint32 //time used for calculate unbound ong
	Amount       uint64 //unbound ong that this penalty unbounded
}

func (*PenaltyStake) Deserialization added in v1.8.1

func (this *PenaltyStake) Deserialization(source *common.ZeroCopySource) error

func (*PenaltyStake) Serialization added in v1.8.1

func (this *PenaltyStake) Serialization(sink *common.ZeroCopySink)

type PreConfig added in v1.0.3

type PreConfig struct {
	Configuration *Configuration
	SetView       uint32
}

func (*PreConfig) Deserialization added in v1.8.1

func (this *PreConfig) Deserialization(source *common.ZeroCopySource) error

func (*PreConfig) Serialization added in v1.8.1

func (this *PreConfig) Serialization(sink *common.ZeroCopySink)

type PromisePos added in v1.0.3

type PromisePos struct {
	PeerPubkey string
	PromisePos uint64
}

func (*PromisePos) Deserialization added in v1.8.1

func (this *PromisePos) Deserialization(source *common.ZeroCopySource) error

func (*PromisePos) Serialization added in v1.8.1

func (this *PromisePos) Serialization(sink *common.ZeroCopySink)

type QuitNodeParam

type QuitNodeParam struct {
	PeerPubkey string
	Address    common.Address
}

func (*QuitNodeParam) Deserialization added in v1.8.1

func (this *QuitNodeParam) Deserialization(source *common.ZeroCopySource) error

func (*QuitNodeParam) Serialization added in v1.8.1

func (this *QuitNodeParam) Serialization(sink *common.ZeroCopySink)

type RegisterCandidateParam

type RegisterCandidateParam struct {
	PeerPubkey string
	Address    common.Address
	InitPos    uint32
	Caller     []byte
	KeyNo      uint32
}

func (*RegisterCandidateParam) Deserialization added in v1.8.1

func (this *RegisterCandidateParam) Deserialization(source *common.ZeroCopySource) error

func (*RegisterCandidateParam) Serialization added in v1.8.1

func (this *RegisterCandidateParam) Serialization(sink *common.ZeroCopySink)

type RejectCandidateParam

type RejectCandidateParam struct {
	PeerPubkey string
}

func (*RejectCandidateParam) Deserialization added in v1.8.1

func (this *RejectCandidateParam) Deserialization(source *common.ZeroCopySource) error

func (*RejectCandidateParam) Serialization added in v1.8.1

func (this *RejectCandidateParam) Serialization(sink *common.ZeroCopySink)

type SetFeePercentageParam added in v1.12.0

type SetFeePercentageParam struct {
	PeerPubkey string
	Address    common.Address
	PeerCost   uint32
	StakeCost  uint32
}

func (*SetFeePercentageParam) Deserialization added in v1.12.0

func (this *SetFeePercentageParam) Deserialization(source *common.ZeroCopySource) error

func (*SetFeePercentageParam) Serialization added in v1.12.0

func (this *SetFeePercentageParam) Serialization(sink *common.ZeroCopySink) error

type SetPeerCostParam added in v1.0.3

type SetPeerCostParam struct {
	PeerPubkey string
	Address    common.Address
	PeerCost   uint32
}

func (*SetPeerCostParam) Deserialization added in v1.8.1

func (this *SetPeerCostParam) Deserialization(source *common.ZeroCopySource) error

func (*SetPeerCostParam) Serialization added in v1.8.1

func (this *SetPeerCostParam) Serialization(sink *common.ZeroCopySink) error

type SplitCurve

type SplitCurve struct {
	Yi []uint32
}

func (*SplitCurve) Deserialization added in v1.8.1

func (this *SplitCurve) Deserialization(source *common.ZeroCopySource) error

func (*SplitCurve) Serialization added in v1.8.1

func (this *SplitCurve) Serialization(sink *common.ZeroCopySink) error

type SplitFeeAddress added in v1.0.3

type SplitFeeAddress struct {
	Address common.Address
	Amount  uint64
}

func (*SplitFeeAddress) Deserialization added in v1.8.1

func (this *SplitFeeAddress) Deserialization(source *common.ZeroCopySource) error

func (*SplitFeeAddress) Serialization added in v1.8.1

func (this *SplitFeeAddress) Serialization(sink *common.ZeroCopySink)

type Status

type Status uint8
const (
	//status
	RegisterCandidateStatus Status = iota
	CandidateStatus
	ConsensusStatus
	QuitConsensusStatus
	QuitingStatus
	BlackStatus
)

func (*Status) Deserialization added in v1.8.1

func (this *Status) Deserialization(source *common.ZeroCopySource) error

func (*Status) Serialization added in v1.8.1

func (this *Status) Serialization(sink *common.ZeroCopySink)

type TotalStake

type TotalStake struct {
	Address    common.Address
	Stake      uint64
	TimeOffset uint32
}

func (*TotalStake) Deserialization added in v1.8.1

func (this *TotalStake) Deserialization(source *common.ZeroCopySource) error

func (*TotalStake) Serialization added in v1.8.1

func (this *TotalStake) Serialization(sink *common.ZeroCopySink)

type TransferPenaltyParam

type TransferPenaltyParam struct {
	PeerPubkey string
	Address    common.Address
}

func (*TransferPenaltyParam) Deserialization added in v1.8.1

func (this *TransferPenaltyParam) Deserialization(source *common.ZeroCopySource) error

func (*TransferPenaltyParam) Serialization added in v1.8.1

func (this *TransferPenaltyParam) Serialization(sink *common.ZeroCopySink)

type UnRegisterCandidateParam

type UnRegisterCandidateParam struct {
	PeerPubkey string
	Address    common.Address
}

func (*UnRegisterCandidateParam) Deserialization added in v1.8.1

func (this *UnRegisterCandidateParam) Deserialization(source *common.ZeroCopySource) error

func (*UnRegisterCandidateParam) Serialization added in v1.8.1

func (this *UnRegisterCandidateParam) Serialization(sink *common.ZeroCopySink)

type WhiteNodeParam

type WhiteNodeParam struct {
	PeerPubkey string
}

func (*WhiteNodeParam) Deserialization added in v1.8.1

func (this *WhiteNodeParam) Deserialization(source *common.ZeroCopySource) error

func (*WhiteNodeParam) Serialization added in v1.8.1

func (this *WhiteNodeParam) Serialization(sink *common.ZeroCopySink)

type WithdrawFeeParam added in v1.0.3

type WithdrawFeeParam struct {
	Address common.Address
}

func (*WithdrawFeeParam) Deserialization added in v1.8.1

func (this *WithdrawFeeParam) Deserialization(source *common.ZeroCopySource) error

func (*WithdrawFeeParam) Serialization added in v1.8.1

func (this *WithdrawFeeParam) Serialization(sink *common.ZeroCopySink)

type WithdrawOngParam added in v0.9.2

type WithdrawOngParam struct {
	Address common.Address
}

func (*WithdrawOngParam) Deserialization added in v1.8.1

func (this *WithdrawOngParam) Deserialization(source *common.ZeroCopySource) error

func (*WithdrawOngParam) Serialization added in v1.8.1

func (this *WithdrawOngParam) Serialization(sink *common.ZeroCopySink)

type WithdrawParam

type WithdrawParam struct {
	Address        common.Address
	PeerPubkeyList []string
	WithdrawList   []uint32
}

func (*WithdrawParam) Deserialization added in v1.8.1

func (this *WithdrawParam) Deserialization(source *common.ZeroCopySource) error

func (*WithdrawParam) Serialization added in v1.8.1

func (this *WithdrawParam) Serialization(sink *common.ZeroCopySink) error

Jump to

Keyboard shortcuts

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