executor

package
v1.67.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ListDESC    = int32(0)
	ListASC     = int32(1)
	DefultCount = int32(20)  //默认一次取多少条记录
	MaxCount    = int32(100) //最多取100条
)

List control

View Source
const (
	FiveStar  = 5
	ThreeStar = 3
	TwoStar   = 2
	OneStar   = 1
)

Star level

Variables

This section is empty.

Functions

func GetName

func GetName() string

GetName for lottery

func Init

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

Init lottery

func InitExecType

func InitExecType()

InitExecType ...

func Key

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

Key for lottery

func ListLotteryBuyRecords

func ListLotteryBuyRecords(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryBuyHistory) (types.Message, error)

ListLotteryBuyRecords for addr

func ListLotteryGainRecords

func ListLotteryGainRecords(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryGainHistory) (types.Message, error)

ListLotteryGainRecords for addr

func ListLotteryLuckyHistory

func ListLotteryLuckyHistory(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryLuckyHistory) (types.Message, error)

ListLotteryLuckyHistory returns all the luckynum in history

Types

type Action

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

Action struct

func NewLotteryAction

func NewLotteryAction(l *Lottery, tx *types.Transaction, index int) *Action

NewLotteryAction generate New Action

func (*Action) CheckExecAccount

func (action *Action) CheckExecAccount(addr string, amount int64, isFrozen bool) bool

CheckExecAccount check the account avoiding rollback

func (*Action) GetBuyReceiptLog

func (action *Action) GetBuyReceiptLog(lottery *pty.Lottery, preStatus int32, round int64, buyNumber int64, amount int64, way int64) *types.ReceiptLog

GetBuyReceiptLog generate logs for lottery buy action

func (*Action) GetCloseReceiptLog

func (action *Action) GetCloseReceiptLog(lottery *pty.Lottery, preStatus int32) *types.ReceiptLog

GetCloseReceiptLog generate logs for lottery close action

func (*Action) GetCreateReceiptLog

func (action *Action) GetCreateReceiptLog(lottery *pty.Lottery, preStatus int32) *types.ReceiptLog

GetCreateReceiptLog generate logs for lottery create action

func (*Action) GetDrawReceiptLog

func (action *Action) GetDrawReceiptLog(lottery *pty.Lottery, preStatus int32, round int64, luckyNum int64, updateInfo *pty.LotteryUpdateBuyInfo, addrNumThisRound int64, buyAmountThisRound int64, gainInfos *pty.LotteryGainInfos,
	luckyAddrNum int64, totalFund int64, factor int64) *types.ReceiptLog

GetDrawReceiptLog generate logs for lottery draw action

func (*Action) GetIndex

func (action *Action) GetIndex() int64

GetIndex returns index in block

func (*Action) GetLottCommonRecipt

func (action *Action) GetLottCommonRecipt(lottery *pty.Lottery, preStatus int32) *pty.ReceiptLottery

GetLottCommonRecipt generate logs for lottery common action

func (*Action) LotteryBuy

func (action *Action) LotteryBuy(buy *pty.LotteryBuy) (*types.Receipt, error)

LotteryBuy Action One coin for one ticket

func (*Action) LotteryClose

func (action *Action) LotteryClose(draw *pty.LotteryClose) (*types.Receipt, error)

LotteryClose Action

func (*Action) LotteryCreate

func (action *Action) LotteryCreate(create *pty.LotteryCreate) (*types.Receipt, error)

LotteryCreate Action creator should be valid

func (*Action) LotteryDraw

func (action *Action) LotteryDraw(draw *pty.LotteryDraw) (*types.Receipt, error)

LotteryDraw Action

type Lottery

type Lottery struct {
	drivers.DriverBase
}

Lottery driver

func (*Lottery) CheckReceiptExecOk

func (lott *Lottery) CheckReceiptExecOk() bool

CheckReceiptExecOk return true to check if receipt ty is ok

func (*Lottery) ExecDelLocal_Buy

func (l *Lottery) ExecDelLocal_Buy(payload *pty.LotteryBuy, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Buy Action

func (*Lottery) ExecDelLocal_Close

func (l *Lottery) ExecDelLocal_Close(payload *pty.LotteryClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Close Action

func (*Lottery) ExecDelLocal_Create

func (l *Lottery) ExecDelLocal_Create(payload *pty.LotteryCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Create Action

func (*Lottery) ExecDelLocal_Draw

func (l *Lottery) ExecDelLocal_Draw(payload *pty.LotteryDraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal_Draw Action

func (*Lottery) ExecLocal_Buy

func (l *Lottery) ExecLocal_Buy(payload *pty.LotteryBuy, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Buy Action

func (*Lottery) ExecLocal_Close

func (l *Lottery) ExecLocal_Close(payload *pty.LotteryClose, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Close Action

func (*Lottery) ExecLocal_Create

func (l *Lottery) ExecLocal_Create(payload *pty.LotteryCreate, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Create Action

func (*Lottery) ExecLocal_Draw

func (l *Lottery) ExecLocal_Draw(payload *pty.LotteryDraw, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecLocal_Draw Action

func (*Lottery) Exec_Buy

func (l *Lottery) Exec_Buy(payload *pty.LotteryBuy, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Buy Action

func (*Lottery) Exec_Close

func (l *Lottery) Exec_Close(payload *pty.LotteryClose, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Close Action

func (*Lottery) Exec_Create

func (l *Lottery) Exec_Create(payload *pty.LotteryCreate, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Create Action

func (*Lottery) Exec_Draw

func (l *Lottery) Exec_Draw(payload *pty.LotteryDraw, tx *types.Transaction, index int) (*types.Receipt, error)

Exec_Draw Action

func (*Lottery) GetDriverName

func (lott *Lottery) GetDriverName() string

GetDriverName for lottery

func (*Lottery) GetPayloadValue

func (lott *Lottery) GetPayloadValue() types.Message

GetPayloadValue lotteryAction

func (*Lottery) Query_GetLotteryBuyRoundInfo

func (l *Lottery) Query_GetLotteryBuyRoundInfo(param *pty.ReqLotteryBuyInfo) (types.Message, error)

Query_GetLotteryBuyRoundInfo for each round

func (*Lottery) Query_GetLotteryCurrentInfo

func (l *Lottery) Query_GetLotteryCurrentInfo(param *pty.ReqLotteryInfo) (types.Message, error)

Query_GetLotteryCurrentInfo state

func (*Lottery) Query_GetLotteryHistoryBuyInfo

func (l *Lottery) Query_GetLotteryHistoryBuyInfo(param *pty.ReqLotteryBuyHistory) (types.Message, error)

Query_GetLotteryHistoryBuyInfo for all history

func (*Lottery) Query_GetLotteryHistoryGainInfo

func (l *Lottery) Query_GetLotteryHistoryGainInfo(param *pty.ReqLotteryGainHistory) (types.Message, error)

Query_GetLotteryHistoryGainInfo for all history

func (*Lottery) Query_GetLotteryHistoryLuckyNumber

func (l *Lottery) Query_GetLotteryHistoryLuckyNumber(param *pty.ReqLotteryLuckyHistory) (types.Message, error)

Query_GetLotteryHistoryLuckyNumber for all history

func (*Lottery) Query_GetLotteryNormalInfo

func (l *Lottery) Query_GetLotteryNormalInfo(param *pty.ReqLotteryInfo) (types.Message, error)

Query_GetLotteryNormalInfo not changed info

func (*Lottery) Query_GetLotteryPurchaseAddr

func (l *Lottery) Query_GetLotteryPurchaseAddr(param *pty.ReqLotteryInfo) (types.Message, error)

Query_GetLotteryPurchaseAddr for current round

func (*Lottery) Query_GetLotteryRoundGainInfo

func (l *Lottery) Query_GetLotteryRoundGainInfo(param *pty.ReqLotteryGainInfo) (types.Message, error)

Query_GetLotteryRoundGainInfo for each round

func (*Lottery) Query_GetLotteryRoundLuckyNumber

func (l *Lottery) Query_GetLotteryRoundLuckyNumber(param *pty.ReqLotteryLuckyInfo) (types.Message, error)

Query_GetLotteryRoundLuckyNumber for each round

type LotteryDB

type LotteryDB struct {
	pty.Lottery
}

LotteryDB def

func NewLotteryDB

func NewLotteryDB(lotteryID string, purBlock int64, drawBlock int64,
	blockHeight int64, addr string) *LotteryDB

NewLotteryDB New management instance

func (*LotteryDB) GetKVSet

func (lott *LotteryDB) GetKVSet() (kvset []*types.KeyValue)

GetKVSet for LotteryDB

func (*LotteryDB) Save

func (lott *LotteryDB) Save(db dbm.KV)

Save for LotteryDB

Jump to

Keyboard shortcuts

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