Documentation ¶
Index ¶
- Constants
- func GetName() string
- func Init(name string, sub []byte)
- func Key(id string) (key []byte)
- type Action
- func (action *Action) CheckExecAccountBalance(fromAddr string, ToFrozen, ToActive int64) bool
- func (action *Action) GameAbort(pbend *gty.GuessGameAbort) (*types.Receipt, error)
- func (action *Action) GameBet(pbBet *gty.GuessGameBet) (*types.Receipt, error)
- func (action *Action) GamePublish(publish *gty.GuessGamePublish) (*types.Receipt, error)
- func (action *Action) GameStart(start *gty.GuessGameStart) (*types.Receipt, error)
- func (action *Action) GameStopBet(pbBet *gty.GuessGameStopBet) (*types.Receipt, error)
- type Guess
- func (g *Guess) CheckReceiptExecOk() bool
- func (g *Guess) ExecDelLocal_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecDelLocal_Bet(payload *gty.GuessGameBet, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecDelLocal_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecDelLocal_Start(payload *gty.GuessGameStart, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecLocal_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecLocal_Bet(payload *gty.GuessGameBet, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecLocal_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecLocal_Start(payload *gty.GuessGameStart, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (g *Guess) ExecLocal_StopBet(payload *gty.GuessGameStopBet, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (c *Guess) Exec_Abort(payload *gty.GuessGameAbort, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Guess) Exec_Bet(payload *gty.GuessGameBet, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Guess) Exec_Publish(payload *gty.GuessGamePublish, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Guess) Exec_Start(payload *gty.GuessGameStart, tx *types.Transaction, index int) (*types.Receipt, error)
- func (c *Guess) Exec_StopBet(payload *gty.GuessGameStopBet, tx *types.Transaction, index int) (*types.Receipt, error)
- func (g *Guess) ExecutorOrder() int64
- func (g *Guess) GetDriverName() string
- func (g *Guess) Query_QueryGameByID(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByAddr(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByAddrStatus(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByAdminAddr(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByAdminStatus(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByCategoryStatus(in *gty.QueryGuessGameInfo) (types.Message, error)
- func (g *Guess) Query_QueryGamesByIDs(in *gty.QueryGuessGameInfos) (types.Message, error)
- func (g *Guess) Query_QueryGamesByStatus(in *gty.QueryGuessGameInfo) (types.Message, error)
Constants ¶
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 ¶
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 ¶
CheckExecAccountBalance 检查地址在Guess合约中的余额是否足够
func (*Action) GamePublish ¶
GamePublish 公布竞猜游戏结果动作执行
func (*Action) GameStopBet ¶
GameStopBet 停止游戏下注动作执行
type Guess ¶
type Guess struct {
drivers.DriverBase
}
Guess 执行器,用于竞猜合约的具体执行
func (*Guess) CheckReceiptExecOk ¶
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 ¶
ExecutorOrder Exec 的时候 同时执行 ExecLocal
func (*Guess) Query_QueryGameByID ¶
Query_QueryGameByID method
func (*Guess) Query_QueryGamesByAddr ¶
Query_QueryGamesByAddr method
func (*Guess) Query_QueryGamesByAddrStatus ¶
Query_QueryGamesByAddrStatus method
func (*Guess) Query_QueryGamesByAdminAddr ¶
Query_QueryGamesByAdminAddr method
func (*Guess) Query_QueryGamesByAdminStatus ¶
Query_QueryGamesByAdminStatus method
func (*Guess) Query_QueryGamesByCategoryStatus ¶
Query_QueryGamesByCategoryStatus method
func (*Guess) Query_QueryGamesByIDs ¶
Query_QueryGamesByIDs method
func (*Guess) Query_QueryGamesByStatus ¶
Query_QueryGamesByStatus method