lottery

package
v0.0.0-...-ddf2b42 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

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