diff options
author | Haoping Ku <haoping.ku@dexon.org> | 2018-07-30 11:40:16 +0800 |
---|---|---|
committer | Wei-Ning Huang <aitjcize@gmail.com> | 2018-07-30 11:40:16 +0800 |
commit | aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb (patch) | |
tree | 1682bfaa9abca34ef51e57ac527f5b28eb504106 /core/types/block.go | |
parent | 279daea6e004ab6ad9d079ccc35b7c52d79630ad (diff) | |
download | dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar.gz dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar.bz2 dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar.lz dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar.xz dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.tar.zst dexon-consensus-aaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb.zip |
Add acking module (#13)
* Refactor and add acking module
Extract acking module for unit testing. This commit splits functions
into small pieces for better understanding and easy unit testing.
Diffstat (limited to 'core/types/block.go')
-rw-r--r-- | core/types/block.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/types/block.go b/core/types/block.go index 6762f14..217ea73 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -25,14 +25,14 @@ import ( "github.com/dexon-foundation/dexon-consensus-core/common" ) -// State represents the block process state. -type State int +// Status represents the block process state. +type Status int // Block Status. const ( - BlockStatusInit State = iota + BlockStatusInit Status = iota BlockStatusAcked - BlockStatusToTo + BlockStatusOrdering BlockStatusFinal ) @@ -45,8 +45,9 @@ type Block struct { Timestamps map[ValidatorID]time.Time `json:"timestamps"` Acks map[common.Hash]struct{} `json:"acks"` - Ackeds map[common.Hash]struct{} `json:"-"` - State State `json:"-"` + Ackeds map[common.Hash]struct{} `json:"-"` + AckedValidators map[ValidatorID]struct{} `json:"-"` + Status Status `json:"-"` } func (b *Block) String() string { |