aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-03 10:01:40 +0800
committerGitHub <noreply@github.com>2018-09-03 10:01:40 +0800
commitc8d3092208f73ee991a123052a71b7dbf7fffc27 (patch)
treefdcb3b90b859531e042dbbdd6bcd7b0cca40e86a /integration_test
parent9491ddae81640e04f8aed38e2cddeb64cc62d55b (diff)
downloaddexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.gz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.bz2
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.lz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.xz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.zst
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.zip
core: Add a new structure `Position` and move `ShardID`, `ChainID` and `Height` from `Block` (#89)
Diffstat (limited to 'integration_test')
-rw-r--r--integration_test/validator.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/integration_test/validator.go b/integration_test/validator.go
index 53f9456..25cbac0 100644
--- a/integration_test/validator.go
+++ b/integration_test/validator.go
@@ -65,7 +65,7 @@ func NewReceiveBlockEvent(
// Validator is designed to work with test.Scheduler.
type Validator struct {
ID types.ValidatorID
- chainID uint64
+ chainID uint32
cons *core.Consensus
gov core.Governance
networkLatency LatencyModel
@@ -87,10 +87,10 @@ func NewValidator(
hashes = append(hashes, vID.Hash)
}
sort.Sort(hashes)
- chainID := uint64(0)
+ chainID := uint32(0)
for i, hash := range hashes {
if hash == vID.Hash {
- chainID = uint64(i)
+ chainID = uint32(i)
break
}
}
@@ -125,7 +125,9 @@ func (v *Validator) handleProposeBlock(when time.Time, piggyback interface{}) (
b := &types.Block{
ProposerID: v.ID,
- ChainID: v.chainID,
+ Position: types.Position{
+ ChainID: v.chainID,
+ },
}
defer types.RecycleBlock(b)
if err = v.cons.PrepareBlock(b, when); err != nil {