From 097f778c1e7e4748f17cb852509df10ba61cae26 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 4 Jun 2018 20:48:35 -0700 Subject: [PATCH] fix byz-test --- consensus/byzantine_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index f18f16230..a8f559f60 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -105,15 +105,18 @@ func TestByzantine(t *testing.T) { 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++ { cr := reactors[i].(*ConsensusReactor) 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] // and the other block to peers[1] and peers[2]. // note peers and switches order don't match.