diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-07-20 09:52:52 +0800 |
---|---|---|
committer | missionliao <38416648+missionliao@users.noreply.github.com> | 2018-07-20 09:52:52 +0800 |
commit | dfa19fc2b4e38097334f4a30e159f9bcd92909c0 (patch) | |
tree | 718524746a0871a07a4a68dea43481e6ac841b39 /core/blocklattice_test.go | |
parent | 46a84bff9ac419853550f7c17b13fb8633e507c9 (diff) | |
download | dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.gz dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.bz2 dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.lz dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.xz dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.tar.zst dexon-consensus-dfa19fc2b4e38097334f4a30e159f9bcd92909c0.zip |
Implement simulation on a real network (#5)
simulation: implement simulation on a real network
Diffstat (limited to 'core/blocklattice_test.go')
-rw-r--r-- | core/blocklattice_test.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/core/blocklattice_test.go b/core/blocklattice_test.go index 380dc38..f43d645 100644 --- a/core/blocklattice_test.go +++ b/core/blocklattice_test.go @@ -35,17 +35,6 @@ var b01, b11, b21, b31, b02, b12, b22, b32, b03, b13, b23, b33 *types.Block -// TestNetwork. -type TestNetwork struct { -} - -func (n *TestNetwork) Join(endpoint Endpoint) chan interface{} { - return nil -} - -func (n *TestNetwork) BroadcastBlock(block *types.Block) { -} - // TestApp. type TestApp struct { Outputs []*types.Block @@ -78,13 +67,11 @@ func (s *BlockLatticeTest) SetupTest() { s.app = &TestApp{} - lattice = NewBlockLattice( - blockdb.NewMemBackedBlockDB(), - &TestNetwork{}, - s.app) + lattice = NewBlockLattice(blockdb.NewMemBackedBlockDB(), s.app) for i := 0; i < 4; i++ { - validators = append(validators, types.ValidatorID(common.NewRandomHash())) + validators = append(validators, + types.ValidatorID{Hash: common.NewRandomHash()}) Debugf("V%d: %s\n", i, validators[i]) } Debugf("\n") @@ -116,6 +103,7 @@ func (s *BlockLatticeTest) SetupTest() { genesises[3].Hash: struct{}{}, }, } + b11 = &types.Block{ ProposerID: validators[1], ParentHash: genesises[1].Hash, |