executor

package
v1.67.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ListDESC 表示记录降序排列
	ListDESC = int32(0)

	//ListASC 表示记录升序排列
	ListASC = int32(1)

	//DefaultCount 默认一次获取的记录数
	DefaultCount = int32(10)
)

Variables

This section is empty.

Functions

func GetName

func GetName() string

GetName 获取DPos执行器的名称

func Init

func Init(name string, cfg *types.Chain33Config, sub []byte)

Init DPos Executor

func InitExecType

func InitExecType()

InitExecType ...

func Key

func Key(id string) (key []byte)

Key State数据库中存储记录的Key值格式转换

func TopNKey

func TopNKey(id string) (key []byte)

TopNKey State数据库中存储记录的Key值格式转换

Types

type Action

type Action struct {
	// contains filtered or unexported fields
}

Action 具体动作执行

func NewAction

func NewAction(dpos *DPos, tx *types.Transaction, index int) *Action

NewAction 生成Action对象

func (*Action) CancelRegist

func (action *Action) CancelRegist(req *dty.DposCandidatorCancelRegist) (*types.Receipt, error)

CancelRegist 撤销一个候选节点的注册

func (*Action) CancelVote

func (action *Action) CancelVote(vote *dty.DposCancelVote) (*types.Receipt, error)

CancelVote 撤销对某个候选节点的投票

func (*Action) CheckExecAccountBalance

func (action *Action) CheckExecAccountBalance(fromAddr string, ToFrozen, ToActive int64) bool

CheckExecAccountBalance 检查地址在Dpos合约中的余额是否足够

func (*Action) ReRegist

func (action *Action) ReRegist(regist *dty.DposCandidatorRegist) (*types.Receipt, error)

ReRegist 重新注册一个注销的候选节点

func (*Action) RecordCB

func (action *Action) RecordCB(cbInfo *dty.DposCBInfo) (*types.Receipt, error)

RecordCB 记录cycle boundary info

func (*Action) Regist

func (action *Action) Regist(regist *dty.DposCandidatorRegist) (*types.Receipt, error)

Regist 注册候选节点

func (*Action) RegistTopN

func (action *Action) RegistTopN(regist *dty.TopNCandidatorRegist) (*types.Receipt, error)

RegistTopN 注册TopN节点

func (*Action) RegistVrfM

func (action *Action) RegistVrfM(vrfMReg *dty.DposVrfMRegist) (*types.Receipt, error)

RegistVrfM 注册受托节点的Vrf M信息(输入信息)

func (*Action) RegistVrfRP

func (action *Action) RegistVrfRP(vrfRPReg *dty.DposVrfRPRegist) (*types.Receipt, error)

RegistVrfRP 注册受托节点的Vrf R/P信息

func (*Action) Vote

func (action *Action) Vote(vote *dty.DposVote) (*types.Receipt, error)

Vote 为某一个候选节点投票

type CycleInfo

type CycleInfo struct {
	// contains filtered or unexported fields
}

CycleInfo indicates the start and stop of a cycle

type DPos

type DPos struct {
	drivers.DriverBase
}

DPos 执行器,用于Dpos候选节点注册、投票,VRF信息注册管理等功能

func (*DPos) CheckReceiptExecOk

func (g *DPos) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*DPos) ExecDelLocal_CancelRegist

func (d *DPos) ExecDelLocal_CancelRegist(payload *dty.DposCandidatorCancelRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_CancelRegist method

func (*DPos) ExecDelLocal_CancelVote

func (d *DPos) ExecDelLocal_CancelVote(payload *dty.DposCancelVote, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_CancelVote method

func (*DPos) ExecDelLocal_ReRegist

func (d *DPos) ExecDelLocal_ReRegist(payload *dty.DposCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_ReRegist method

func (*DPos) ExecDelLocal_RecordCB

func (d *DPos) ExecDelLocal_RecordCB(payload *dty.DposCBInfo, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_RecordCB method

func (*DPos) ExecDelLocal_Regist

func (d *DPos) ExecDelLocal_Regist(payload *dty.DposCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Regist method

func (*DPos) ExecDelLocal_RegistTopN

func (d *DPos) ExecDelLocal_RegistTopN(payload *dty.TopNCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_RegistTopN method

func (*DPos) ExecDelLocal_Vote

func (d *DPos) ExecDelLocal_Vote(payload *dty.DposVote, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Vote method

func (*DPos) ExecDelLocal_VrfMRegist

func (d *DPos) ExecDelLocal_VrfMRegist(payload *dty.DposVrfMRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_VrfMRegist method

func (*DPos) ExecDelLocal_VrfRPRegist

func (d *DPos) ExecDelLocal_VrfRPRegist(payload *dty.DposVrfRPRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_VrfRPRegist method

func (*DPos) ExecLocal_CancelRegist

func (d *DPos) ExecLocal_CancelRegist(payload *dty.DposCandidatorCancelRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_CancelRegist method

func (*DPos) ExecLocal_CancelVote

func (d *DPos) ExecLocal_CancelVote(payload *dty.DposCancelVote, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_CancelVote method

func (*DPos) ExecLocal_ReRegist

func (d *DPos) ExecLocal_ReRegist(payload *dty.DposCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_ReRegist method

func (*DPos) ExecLocal_RecordCB

func (d *DPos) ExecLocal_RecordCB(payload *dty.DposCBInfo, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_RecordCB method

func (*DPos) ExecLocal_Regist

func (d *DPos) ExecLocal_Regist(payload *dty.DposCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Regist method

func (*DPos) ExecLocal_RegistTopN

func (d *DPos) ExecLocal_RegistTopN(payload *dty.TopNCandidatorRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_RegistTopN method

func (*DPos) ExecLocal_RegistVrfM

func (d *DPos) ExecLocal_RegistVrfM(payload *dty.DposVrfMRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_RegistVrfM method

func (*DPos) ExecLocal_RegistVrfRP

func (d *DPos) ExecLocal_RegistVrfRP(payload *dty.DposVrfRPRegist, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_RegistVrfRP method

func (*DPos) ExecLocal_Vote

func (d *DPos) ExecLocal_Vote(payload *dty.DposVote, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Vote method

func (*DPos) Exec_CancelRegist

func (d *DPos) Exec_CancelRegist(payload *dty.DposCandidatorCancelRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_CancelRegist DPos执行器取消注册候选节点

func (*DPos) Exec_CancelVote

func (d *DPos) Exec_CancelVote(payload *dty.DposCancelVote, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_CancelVote DPos执行器撤销对一个候选节点的投票

func (*DPos) Exec_ReRegist

func (d *DPos) Exec_ReRegist(payload *dty.DposCandidatorRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_ReRegist DPos执行器重新注册候选节点

func (*DPos) Exec_RecordCB

func (d *DPos) Exec_RecordCB(payload *dty.DposCBInfo, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_RecordCB DPos执行器记录CycleBoundary信息

func (*DPos) Exec_Regist

func (d *DPos) Exec_Regist(payload *dty.DposCandidatorRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Regist DPos执行器注册候选节点

func (*DPos) Exec_RegistTopN

func (d *DPos) Exec_RegistTopN(payload *dty.TopNCandidatorRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_RegistTopN DPos执行器注册某一cycle中的TOPN信息

func (*DPos) Exec_RegistVrfM

func (d *DPos) Exec_RegistVrfM(payload *dty.DposVrfMRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_RegistVrfM DPos执行器注册一个受托节点的Vrf M信息

func (*DPos) Exec_RegistVrfRP

func (d *DPos) Exec_RegistVrfRP(payload *dty.DposVrfRPRegist, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_RegistVrfRP DPos执行器注册一个受托节点的Vrf R/P信息

func (*DPos) Exec_Vote

func (d *DPos) Exec_Vote(payload *dty.DposVote, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Vote DPos执行器为候选节点投票

func (*DPos) ExecutorOrder

func (g *DPos) ExecutorOrder() int64

ExecutorOrder Exec 的时候 同时执行 ExecLocal

func (*DPos) GetDriverName

func (g *DPos) GetDriverName() string

GetDriverName 获取DPos执行器的名称

func (*DPos) Query_QueryCBInfoByCycle

func (d *DPos) Query_QueryCBInfoByCycle(in *dty.DposCBQuery) (types.Message, error)

Query_QueryCBInfoByCycle method

func (*DPos) Query_QueryCBInfoByHash

func (d *DPos) Query_QueryCBInfoByHash(in *dty.DposCBQuery) (types.Message, error)

Query_QueryCBInfoByHash method

func (*DPos) Query_QueryCBInfoByHeight

func (d *DPos) Query_QueryCBInfoByHeight(in *dty.DposCBQuery) (types.Message, error)

Query_QueryCBInfoByHeight method

func (*DPos) Query_QueryCandidatorByPubkeys

func (d *DPos) Query_QueryCandidatorByPubkeys(in *dty.CandidatorQuery) (types.Message, error)

Query_QueryCandidatorByPubkeys method

func (*DPos) Query_QueryCandidatorByTopN

func (d *DPos) Query_QueryCandidatorByTopN(in *dty.CandidatorQuery) (types.Message, error)

Query_QueryCandidatorByTopN method

func (*DPos) Query_QueryTopNByVersion

func (d *DPos) Query_QueryTopNByVersion(in *dty.TopNCandidatorsQuery) (types.Message, error)

Query_QueryTopNByVersion method

func (*DPos) Query_QueryVote

func (d *DPos) Query_QueryVote(in *dty.DposVoteQuery) (types.Message, error)

Query_QueryVote method

func (*DPos) Query_QueryVrfByCycle

func (d *DPos) Query_QueryVrfByCycle(in *dty.DposVrfQuery) (types.Message, error)

Query_QueryVrfByCycle method

func (*DPos) Query_QueryVrfByCycleForPubkeys

func (d *DPos) Query_QueryVrfByCycleForPubkeys(in *dty.DposVrfQuery) (types.Message, error)

Query_QueryVrfByCycleForPubkeys method

func (*DPos) Query_QueryVrfByCycleForTopN

func (d *DPos) Query_QueryVrfByCycleForTopN(in *dty.DposVrfQuery) (types.Message, error)

Query_QueryVrfByCycleForTopN method

func (*DPos) Query_QueryVrfByTime

func (d *DPos) Query_QueryVrfByTime(in *dty.DposVrfQuery) (types.Message, error)

Query_QueryVrfByTime method

Jump to

Keyboard shortcuts

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