github.com/cheng762/platon-go@v1.8.17-0.20190529111256-7deff2d7be26/core/ppos/common.go (about)

     1  package pposm
     2  
     3  
     4  const (
     5  
     6  	/** about candidate pool */
     7  	// immediate elected candidate
     8  	ImmediatePrefix     = "id"
     9  	ImmediateListPrefix = "iL"
    10  	// reserve elected candidate
    11  	ReservePrefix     = "rd"
    12  	ReserveListPrefix = "rL"
    13  	// previous witness
    14  	PreWitnessPrefix     = "Pwn"
    15  	PreWitnessListPrefix = "PwL"
    16  	// witness
    17  	WitnessPrefix     = "wn"
    18  	WitnessListPrefix = "wL"
    19  	// next witness
    20  	NextWitnessPrefix     = "Nwn"
    21  	NextWitnessListPrefix = "NwL"
    22  	// need refund
    23  	DefeatPrefix     = "df"
    24  	DefeatListPrefix = "dL"
    25  
    26  	/** about ticket pool */
    27  	// Remaining number key
    28  	SurplusQuantity		= "sq"
    29  	// Expire ticket prefix
    30  	ExpireTicket		= "et"
    31  	// candidate attach
    32  	CandidateAttach	= "ca"
    33  	// Ticket pool hash
    34  	TicketPoolHash	= "tph"
    35  
    36  )
    37  
    38  const (
    39  	PREVIOUS_C = iota -1
    40  	CURRENT_C
    41  	NEXT_C
    42  )
    43  
    44  const (
    45  	IS_LOST = iota
    46  	IS_IMMEDIATE
    47  	IS_RESERVE
    48  )
    49  
    50  var (
    51  
    52  	/** about candidate pool */
    53  	// immediate elected candidate
    54  	ImmediateBytePrefix     = []byte(ImmediatePrefix)
    55  	ImmediateListBytePrefix = []byte(ImmediateListPrefix)
    56  	// reserve elected candidate
    57  	ReserveBytePrefix     = []byte(ReservePrefix)
    58  	ReserveListBytePrefix = []byte(ReserveListPrefix)
    59  	// previous witness
    60  	PreWitnessBytePrefix     = []byte(PreWitnessPrefix)
    61  	PreWitnessListBytePrefix = []byte(PreWitnessListPrefix)
    62  	// witness
    63  	WitnessBytePrefix     = []byte(WitnessPrefix)
    64  	WitnessListBytePrefix = []byte(WitnessListPrefix)
    65  	// next witness
    66  	NextWitnessBytePrefix     = []byte(NextWitnessPrefix)
    67  	NextWitnessListBytePrefix = []byte(NextWitnessListPrefix)
    68  	// need refund
    69  	DefeatBytePrefix     = []byte(DefeatPrefix)
    70  	DefeatListBytePrefix = []byte(DefeatListPrefix)
    71  
    72  	/** about ticket pool */
    73  	// Remaining number key
    74  	SurplusQuantityKey			= []byte(SurplusQuantity)
    75  	// Expire ticket prefix
    76  	ExpireTicketPrefix			= []byte(ExpireTicket)
    77  	CandidateAttachPrefix		= []byte(CandidateAttach)
    78  
    79  	TicketPoolHashKey			= []byte(TicketPoolHash)
    80  
    81  )