Browse Source

fix byz-test

pull/1683/head
Ethan Buchman 7 years ago
parent
commit
097f778c1e
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      consensus/byzantine_test.go

+ 7
- 4
consensus/byzantine_test.go View File

@ -105,15 +105,18 @@ func TestByzantine(t *testing.T) {
p2p.Connect2Switches(sws, i, j) p2p.Connect2Switches(sws, i, j)
}) })
// start the state machines
byzR := reactors[0].(*ByzantineReactor)
s := byzR.reactor.conS.GetState()
byzR.reactor.SwitchToConsensus(s, 0)
// start the non-byz state machines.
// note these must be started before the byz
for i := 1; i < N; i++ { for i := 1; i < N; i++ {
cr := reactors[i].(*ConsensusReactor) cr := reactors[i].(*ConsensusReactor)
cr.SwitchToConsensus(cr.conS.GetState(), 0) cr.SwitchToConsensus(cr.conS.GetState(), 0)
} }
// start the byzantine state machine
byzR := reactors[0].(*ByzantineReactor)
s := byzR.reactor.conS.GetState()
byzR.reactor.SwitchToConsensus(s, 0)
// byz proposer sends one block to peers[0] // byz proposer sends one block to peers[0]
// and the other block to peers[1] and peers[2]. // and the other block to peers[1] and peers[2].
// note peers and switches order don't match. // note peers and switches order don't match.


Loading…
Cancel
Save