executor

package
Version: v1.67.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: BSD-3-Clause Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName() string

GetName 获取执行器别名

func Init

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

Init 重命名执行器名称

func InitExecType

func InitExecType()

InitExecType ...

Types

type Blackwhite

type Blackwhite struct {
	drivers.DriverBase
}

Blackwhite 几类执行器结构体

func (*Blackwhite) CheckReceiptExecOk

func (c *Blackwhite) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Blackwhite) ExecDelLocal_Create

func (c *Blackwhite) ExecDelLocal_Create(payload *gt.BlackwhiteCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Create 执行删除创建游戏产生的本地数据库

func (*Blackwhite) ExecDelLocal_Play

func (c *Blackwhite) ExecDelLocal_Play(payload *gt.BlackwhitePlay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Play 执行删除参与游戏产生的本地数据库

func (*Blackwhite) ExecDelLocal_Show

func (c *Blackwhite) ExecDelLocal_Show(payload *gt.BlackwhiteShow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Show 执行删除出示密钥产生的本地数据库

func (*Blackwhite) ExecDelLocal_TimeoutDone

func (c *Blackwhite) ExecDelLocal_TimeoutDone(payload *gt.BlackwhiteTimeoutDone, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_TimeoutDone 执行删除超时产生的本地数据库

func (*Blackwhite) ExecLocal_Create

func (c *Blackwhite) ExecLocal_Create(payload *gt.BlackwhiteCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Create 执行生成创建游戏产生的本地数据库

func (*Blackwhite) ExecLocal_Play

func (c *Blackwhite) ExecLocal_Play(payload *gt.BlackwhitePlay, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Play 执行生成参与游戏产生的本地数据库

func (*Blackwhite) ExecLocal_Show

func (c *Blackwhite) ExecLocal_Show(payload *gt.BlackwhiteShow, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Show 执行生成出示密钥产生的本地数据库

func (*Blackwhite) ExecLocal_TimeoutDone

func (c *Blackwhite) ExecLocal_TimeoutDone(payload *gt.BlackwhiteTimeoutDone, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_TimeoutDone 执行生成超时产生的本地数据库

func (*Blackwhite) Exec_Create

func (c *Blackwhite) Exec_Create(payload *gt.BlackwhiteCreate, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Create 创建游戏

func (*Blackwhite) Exec_Play

func (c *Blackwhite) Exec_Play(payload *gt.BlackwhitePlay, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Play 参与游戏

func (*Blackwhite) Exec_Show

func (c *Blackwhite) Exec_Show(payload *gt.BlackwhiteShow, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Show 出示密钥

func (*Blackwhite) Exec_TimeoutDone

func (c *Blackwhite) Exec_TimeoutDone(payload *gt.BlackwhiteTimeoutDone, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_TimeoutDone 超时处理

func (*Blackwhite) GetBlackwhiteRoundInfo

func (c *Blackwhite) GetBlackwhiteRoundInfo(req *gt.ReqBlackwhiteRoundInfo) (types.Message, error)

GetBlackwhiteRoundInfo 获取当前游戏信息

func (*Blackwhite) GetBwRoundListInfo

func (c *Blackwhite) GetBwRoundListInfo(req *gt.ReqBlackwhiteRoundList) (types.Message, error)

GetBwRoundListInfo 根据要求获取游戏信息,包括游戏所处状态,或者参与者地址

func (*Blackwhite) GetBwRoundLoopResult

func (c *Blackwhite) GetBwRoundLoopResult(req *gt.ReqLoopResult) (types.Message, error)

GetBwRoundLoopResult 获取游戏中每轮的胜负结果

func (*Blackwhite) GetDriverName

func (c *Blackwhite) GetDriverName() string

GetDriverName 获取执行器名字

func (*Blackwhite) GetPayloadValue

func (c *Blackwhite) GetPayloadValue() types.Message

GetPayloadValue 获取执行器action结构体

func (*Blackwhite) Query_GetBlackwhiteByStatusAndAddr

func (c *Blackwhite) Query_GetBlackwhiteByStatusAndAddr(in *gt.ReqBlackwhiteRoundList) (types.Message, error)

Query_GetBlackwhiteByStatusAndAddr 查询符合状态以及地址的游戏信息

func (*Blackwhite) Query_GetBlackwhiteRoundInfo

func (c *Blackwhite) Query_GetBlackwhiteRoundInfo(in *gt.ReqBlackwhiteRoundInfo) (types.Message, error)

Query_GetBlackwhiteRoundInfo 查询游戏信息

func (*Blackwhite) Query_GetBlackwhiteloopResult

func (c *Blackwhite) Query_GetBlackwhiteloopResult(in *gt.ReqLoopResult) (types.Message, error)

Query_GetBlackwhiteloopResult 查询游戏中每轮次的比赛结果

type BlackwhiteCreateTxReq

type BlackwhiteCreateTxReq struct {
	PlayAmount  int64  `json:"amount"`
	PlayerCount int32  `json:"playerCount"`
	Timeout     int64  `json:"timeout"`
	GameName    string `json:"gameName"`
	Fee         int64  `json:"fee"`
}

BlackwhiteCreateTxReq 创建游戏结构体

type BlackwhitePlayTx

type BlackwhitePlayTx struct {
	GameID     string   `json:"gameID"`
	Amount     int64    `json:"amount"`
	HashValues [][]byte `json:"hashValues"`
	Fee        int64    `json:"fee"`
}

BlackwhitePlayTx 参与游戏结构体

type BlackwhiteShowTx

type BlackwhiteShowTx struct {
	GameID string `json:"gameID"`
	Secret string `json:"secret"`
	Fee    int64  `json:"fee"`
}

BlackwhiteShowTx 出示密钥结构体

type BlackwhiteTimeoutDoneTx

type BlackwhiteTimeoutDoneTx struct {
	GameID string `json:"GameID"`
	Fee    int64  `json:"fee"`
}

BlackwhiteTimeoutDoneTx 游戏超时结构体

Jump to

Keyboard shortcuts

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