lottery

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N           = 6
	FIRST       = 1 //一等奖数目
	SECOND      = 0 //二等奖数目
	THIRD       = 0 //三等奖数目
	PackageName = "彩票奖励"
)

Variables

View Source
var (
	FIRSTPRIZE   *big.Int = big.NewInt(6e+18) //一等奖金额  5man
	SENCONDPRIZE *big.Int = big.NewInt(3e+18) //二等奖金额 2man
	THIRDPRIZE   *big.Int = big.NewInt(1e+18) //三等奖金额 1man
)

Functions

This section is empty.

Types

type ChainReader

type ChainReader interface {
	GetBlockByNumber(number uint64) *types.Block
	Config() *params.ChainConfig
}

type LotterySeed

type LotterySeed interface {
	GetRandom(hash common.Hash, Type string) (*big.Int, error)
}

type TxCmpResult

type TxCmpResult struct {
	Tx        types.SelfTransaction
	CmpResult uint64
}

type TxCmpResultList

type TxCmpResultList []TxCmpResult

A slice of Pairs that implements sort.Interface to sort by Value.

func (TxCmpResultList) Len

func (p TxCmpResultList) Len() int

func (TxCmpResultList) Less

func (p TxCmpResultList) Less(i, j int) bool

func (TxCmpResultList) Swap

func (p TxCmpResultList) Swap(i, j int)

type TxsLottery

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

func New

func New(chain ChainReader, st util.StateDB, seed LotterySeed, preSt util.StateDB) *TxsLottery

func (*TxsLottery) AddAccountToState

func (tlr *TxsLottery) AddAccountToState(state util.StateDB, account common.Address)

func (*TxsLottery) GetAccountFromState

func (tlr *TxsLottery) GetAccountFromState(state util.StateDB) ([]common.Address, error)

func (*TxsLottery) LotteryCalc

func (tlr *TxsLottery) LotteryCalc(parentHash common.Hash, num uint64) map[common.Address]*big.Int

func (*TxsLottery) LotterySaveAccount

func (tlr *TxsLottery) LotterySaveAccount(accounts []common.Address, vrfInfo []byte)

func (*TxsLottery) ProcessMatrixState

func (tlr *TxsLottery) ProcessMatrixState(num uint64) bool

func (*TxsLottery) ResetAccountToState

func (tlr *TxsLottery) ResetAccountToState()

Jump to

Keyboard shortcuts

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