aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorHaoping Ku <haoping.ku@dexon.org>2018-07-30 11:40:16 +0800
committerWei-Ning Huang <aitjcize@gmail.com>2018-07-30 11:40:16 +0800
commitaaeaebaf5dec3a9a17d0a626cb19e76834f9e4cb (patch)
tree1682bfaa9abca34ef51e57ac527f5b28eb504106 /core/types
parent279daea6e004ab6ad9d079ccc35b7c52d79630ad (diff)
downloaddexon-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')
-rw-r--r--core/types/block.go13
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 {