modify shard state

pull/516/head
Minh Doan 6 years ago committed by Minh Doan
parent 03f1dd69b5
commit b48a7ca9e6
  1. 15
      core/types/shard_state.go

@ -7,8 +7,17 @@ import (
"golang.org/x/crypto/sha3"
)
// NodeID is a unique ID represent a node
type NodeID string
type NodeRole byte
const (
Leader NodeRole = iota
Validator
)
type NodeInfo struct {
NodeID string
Role NodeRole
}
// ShardState is the collection of all committees
type ShardState []Committee
@ -16,7 +25,7 @@ type ShardState []Committee
// Committee contains the active nodes in one shard
type Committee struct {
ShardID uint32
NodeList []NodeID // a list of NodeID where NodeID is represented by a string
NodeList []NodeInfo
}
// GetHashFromNodeList will sort the list, then use Keccak256 to hash the list

Loading…
Cancel
Save