executor

package
v1.68.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

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

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

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

	//DefaultCategory 默认分类
	DefaultCategory = "default"

	//MaxBetsOneTime 一次最多下多少注
	MaxBetsOneTime = 10000e8

	//MaxBetsNumber 一局游戏最多接受多少注
	MaxBetsNumber = 10000000e8

	//MaxBetHeight 距离游戏创建区块的最大可下注高度差
	MaxBetHeight = 1000000

	//MaxExpireHeight 距离游戏创建区块的最大过期高度差
	MaxExpireHeight = 1000000
)

Variables

This section is empty.

Functions

func GetName

func GetName() string

GetName 获取Guess执行器的名称

func Init

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

Init Guess

func InitExecType

func InitExecType()

InitExecType ...

func Key

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

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

Types

type Action

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

Action 具体动作执行

func NewAction

func NewAction(guess *Guess, tx *types.Transaction, index int) *Action

NewAction 生成Action对象

func (*Action) CheckExecAccountBalance

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

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

func (*Action) GameAbort

func (action *Action) GameAbort(pbend *gty.GuessGameAbort) (*types.Receipt, error)

GameAbort 撤销游戏动作执行

func (*Action) GameBet

func (action *Action) GameBet(pbBet *gty.GuessGameBet) (*types.Receipt, error)

GameBet 参与游戏动作执行

func (*Action) GamePublish

func (action *Action) GamePublish(publish *gty.GuessGamePublish) (*types.Receipt, error)

GamePublish 公布竞猜游戏结果动作执行

func (*Action) GameStart

func (action *Action) GameStart(start *gty.GuessGameStart) (*types.Receipt, error)

GameStart 创建游戏动作执行

func (*Action) GameStopBet

func (action *Action) GameStopBet(pbBet *gty.GuessGameStopBet) (*types.Receipt, error)

GameStopBet 停止游戏下注动作执行

type Guess

type Guess struct {
	drivers.DriverBase
}

Guess 执行器,用于竞猜合约的具体执行

func (*Guess) CheckReceiptExecOk

func (g *Guess) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Guess) ExecDelLocal_Abort

func (g *Guess) ExecDelLocal_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Abort Guess执行器Abort交易撤销

func (*Guess) ExecDelLocal_Bet

func (g *Guess) ExecDelLocal_Bet(payload *gty.GuessGameBet, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Bet Guess执行器Bet交易撤销

func (*Guess) ExecDelLocal_Publish

func (g *Guess) ExecDelLocal_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Publish Guess执行器Publish交易撤销

func (*Guess) ExecDelLocal_Start

func (g *Guess) ExecDelLocal_Start(payload *gty.GuessGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Start Guess执行器Start交易撤销

func (*Guess) ExecLocal_Abort

func (g *Guess) ExecLocal_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Abort method

func (*Guess) ExecLocal_Bet

func (g *Guess) ExecLocal_Bet(payload *gty.GuessGameBet, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Bet method

func (*Guess) ExecLocal_Publish

func (g *Guess) ExecLocal_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Publish method

func (*Guess) ExecLocal_Start

func (g *Guess) ExecLocal_Start(payload *gty.GuessGameStart, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Start method

func (*Guess) ExecLocal_StopBet

func (g *Guess) ExecLocal_StopBet(payload *gty.GuessGameStopBet, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_StopBet method

func (*Guess) Exec_Abort

func (c *Guess) Exec_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Abort Guess执行器撤销未结束游戏

func (*Guess) Exec_Bet

func (c *Guess) Exec_Bet(payload *gty.GuessGameBet, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Bet Guess执行器参与游戏

func (*Guess) Exec_Publish

func (c *Guess) Exec_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Publish Guess执行器公布游戏结果

func (*Guess) Exec_Start

func (c *Guess) Exec_Start(payload *gty.GuessGameStart, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Start Guess执行器创建游戏

func (*Guess) Exec_StopBet

func (c *Guess) Exec_StopBet(payload *gty.GuessGameStopBet, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_StopBet Guess执行器停止游戏下注

func (*Guess) ExecutorOrder

func (g *Guess) ExecutorOrder() int64

ExecutorOrder Exec 的时候 同时执行 ExecLocal

func (*Guess) GetDriverName

func (g *Guess) GetDriverName() string

GetDriverName 获取Guess执行器的名称

func (*Guess) Query_QueryGameByID

func (g *Guess) Query_QueryGameByID(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGameByID method

func (*Guess) Query_QueryGamesByAddr

func (g *Guess) Query_QueryGamesByAddr(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByAddr method

func (*Guess) Query_QueryGamesByAddrStatus

func (g *Guess) Query_QueryGamesByAddrStatus(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByAddrStatus method

func (*Guess) Query_QueryGamesByAdminAddr

func (g *Guess) Query_QueryGamesByAdminAddr(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByAdminAddr method

func (*Guess) Query_QueryGamesByAdminStatus

func (g *Guess) Query_QueryGamesByAdminStatus(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByAdminStatus method

func (*Guess) Query_QueryGamesByCategoryStatus

func (g *Guess) Query_QueryGamesByCategoryStatus(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByCategoryStatus method

func (*Guess) Query_QueryGamesByIDs

func (g *Guess) Query_QueryGamesByIDs(in *gty.QueryGuessGameInfos) (types.Message, error)

Query_QueryGamesByIDs method

func (*Guess) Query_QueryGamesByStatus

func (g *Guess) Query_QueryGamesByStatus(in *gty.QueryGuessGameInfo) (types.Message, error)

Query_QueryGamesByStatus method

Jump to

Keyboard shortcuts

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