fix byz-test
This commit is contained in:
parent
5727916c5b
commit
097f778c1e
|
@ -105,15 +105,18 @@ func TestByzantine(t *testing.T) {
|
||||||
p2p.Connect2Switches(sws, i, j)
|
p2p.Connect2Switches(sws, i, j)
|
||||||
})
|
})
|
||||||
|
|
||||||
// start the state machines
|
// start the non-byz state machines.
|
||||||
byzR := reactors[0].(*ByzantineReactor)
|
// note these must be started before the byz
|
||||||
s := byzR.reactor.conS.GetState()
|
|
||||||
byzR.reactor.SwitchToConsensus(s, 0)
|
|
||||||
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…
Reference in New Issue