Documentation ¶
Index ¶
- Constants
- func GetName() string
- func Init(name string, sub []byte)
- func Key(id string) (key []byte)
- func ListLotteryBuyRecords(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryBuyHistory) (types.Message, error)
- func ListLotteryGainRecords(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryGainHistory) (types.Message, error)
- func ListLotteryLuckyHistory(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryLuckyHistory) (types.Message, error)
- type Action
- func (action *Action) CheckExecAccount(addr string, amount int64, isFrozen bool) bool
- func (action *Action) GetBuyReceiptLog(lottery *pty.Lottery, preStatus int32, round int64, buyNumber int64, ...) *types.ReceiptLog
- func (action *Action) GetCloseReceiptLog(lottery *pty.Lottery, preStatus int32) *types.ReceiptLog
- func (action *Action) GetCreateReceiptLog(lottery *pty.Lottery, preStatus int32) *types.ReceiptLog
- func (action *Action) GetDrawReceiptLog(lottery *pty.Lottery, preStatus int32, round int64, luckyNum int64, ...) *types.ReceiptLog
- func (action *Action) GetIndex() int64
- func (action *Action) GetLottCommonRecipt(lottery *pty.Lottery, preStatus int32) *pty.ReceiptLottery
- func (action *Action) LotteryBuy(buy *pty.LotteryBuy) (*types.Receipt, error)
- func (action *Action) LotteryClose(draw *pty.LotteryClose) (*types.Receipt, error)
- func (action *Action) LotteryCreate(create *pty.LotteryCreate) (*types.Receipt, error)
- func (action *Action) LotteryDraw(draw *pty.LotteryDraw) (*types.Receipt, error)
- type Lottery
- func (lott *Lottery) CheckReceiptExecOk() bool
- func (l *Lottery) ExecDelLocal_Buy(payload *pty.LotteryBuy, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecDelLocal_Close(payload *pty.LotteryClose, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecDelLocal_Create(payload *pty.LotteryCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecDelLocal_Draw(payload *pty.LotteryDraw, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecLocal_Buy(payload *pty.LotteryBuy, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecLocal_Close(payload *pty.LotteryClose, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecLocal_Create(payload *pty.LotteryCreate, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) ExecLocal_Draw(payload *pty.LotteryDraw, tx *types.Transaction, ...) (*types.LocalDBSet, error)
- func (l *Lottery) Exec_Buy(payload *pty.LotteryBuy, tx *types.Transaction, index int) (*types.Receipt, error)
- func (l *Lottery) Exec_Close(payload *pty.LotteryClose, tx *types.Transaction, index int) (*types.Receipt, error)
- func (l *Lottery) Exec_Create(payload *pty.LotteryCreate, tx *types.Transaction, index int) (*types.Receipt, error)
- func (l *Lottery) Exec_Draw(payload *pty.LotteryDraw, tx *types.Transaction, index int) (*types.Receipt, error)
- func (lott *Lottery) GetDriverName() string
- func (lott *Lottery) GetPayloadValue() types.Message
- func (l *Lottery) Query_GetLotteryBuyRoundInfo(param *pty.ReqLotteryBuyInfo) (types.Message, error)
- func (l *Lottery) Query_GetLotteryCurrentInfo(param *pty.ReqLotteryInfo) (types.Message, error)
- func (l *Lottery) Query_GetLotteryHistoryBuyInfo(param *pty.ReqLotteryBuyHistory) (types.Message, error)
- func (l *Lottery) Query_GetLotteryHistoryGainInfo(param *pty.ReqLotteryGainHistory) (types.Message, error)
- func (l *Lottery) Query_GetLotteryHistoryLuckyNumber(param *pty.ReqLotteryLuckyHistory) (types.Message, error)
- func (l *Lottery) Query_GetLotteryNormalInfo(param *pty.ReqLotteryInfo) (types.Message, error)
- func (l *Lottery) Query_GetLotteryPurchaseAddr(param *pty.ReqLotteryInfo) (types.Message, error)
- func (l *Lottery) Query_GetLotteryRoundGainInfo(param *pty.ReqLotteryGainInfo) (types.Message, error)
- func (l *Lottery) Query_GetLotteryRoundLuckyNumber(param *pty.ReqLotteryLuckyInfo) (types.Message, error)
- type LotteryDB
Constants ¶
const ( ListDESC = int32(0) ListASC = int32(1) DefultCount = int32(20) //默认一次取多少条记录 MaxCount = int32(100) //最多取100条 )
List control
const ( FiveStar = 5 ThreeStar = 3 TwoStar = 2 OneStar = 1 )
Star level
Variables ¶
This section is empty.
Functions ¶
func ListLotteryBuyRecords ¶
func ListLotteryBuyRecords(db dbm.Lister, stateDB dbm.KV, param *pty.ReqLotteryBuyHistory) (types.Message, error)
ListLotteryBuyRecords for addr
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 ¶
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 ¶
GetCloseReceiptLog generate logs for lottery close action
func (*Action) GetCreateReceiptLog ¶
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) *types.ReceiptLog
GetDrawReceiptLog generate logs for lottery draw action
func (*Action) GetLottCommonRecipt ¶
func (action *Action) GetLottCommonRecipt(lottery *pty.Lottery, preStatus int32) *pty.ReceiptLottery
GetLottCommonRecipt generate logs for lottery common action
func (*Action) LotteryBuy ¶
LotteryBuy Action One coin for one ticket
func (*Action) LotteryClose ¶
LotteryClose Action
func (*Action) LotteryCreate ¶
LotteryCreate Action creator should be valid
func (*Action) LotteryDraw ¶
LotteryDraw Action
type Lottery ¶
type Lottery struct {
drivers.DriverBase
}
Lottery driver
func (*Lottery) CheckReceiptExecOk ¶
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 ¶
GetDriverName for lottery
func (*Lottery) GetPayloadValue ¶
GetPayloadValue lotteryAction
func (*Lottery) Query_GetLotteryBuyRoundInfo ¶
Query_GetLotteryBuyRoundInfo for each round
func (*Lottery) Query_GetLotteryCurrentInfo ¶
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 ¶
Query_GetLotteryNormalInfo not changed info
func (*Lottery) Query_GetLotteryPurchaseAddr ¶
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