aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test/round-event_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-03-22 14:04:30 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-22 14:04:30 +0800
commit49c47180328c06eaeaca9176c2819b55bd75464f (patch)
treef374aaa06404b9054ef85e0a9088900db7bbfce7 /integration_test/round-event_test.go
parent672d245243b6b85040f96e6638628b86975e9a1b (diff)
downloaddexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar.gz
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar.bz2
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar.lz
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar.xz
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.tar.zst
dexon-consensus-49c47180328c06eaeaca9176c2819b55bd75464f.zip
core: height event handlers are not called (#509)
* Make utils.RoundEvent.ValidateNextRound non-blocking * Make NotifyHeight called blockingly * Trigger all height event handlers that should be triggered by initBlock * Fixup: forget the syncer part
Diffstat (limited to 'integration_test/round-event_test.go')
-rw-r--r--integration_test/round-event_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/integration_test/round-event_test.go b/integration_test/round-event_test.go
index d5b432b..b0206ee 100644
--- a/integration_test/round-event_test.go
+++ b/integration_test/round-event_test.go
@@ -136,7 +136,7 @@ func (s *RoundEventTestSuite) TestFromRound0() {
gov.ResetDKG([]byte("DKG round 1 reset 2"))
s.proposeMPK(gov, 1, 2, 3)
s.proposeFinalize(gov, 1, 2, 3)
- rEvt.ValidateNextRound(80)
+ s.Require().Equal(rEvt.ValidateNextRound(80), uint(3))
// Check collected events.
s.Require().Len(evts, 3)
s.Require().Equal(evts[0], evtParamToCheck{0, 1, 100, gov.CRS(0)})
@@ -184,16 +184,16 @@ func (s *RoundEventTestSuite) TestFromRoundN() {
}
})
// Check for round#19, reset(for round#20)#2 at height=2080.
- rEvt.ValidateNextRound(2080)
+ s.Require().Equal(rEvt.ValidateNextRound(2080), uint(2))
// Check collected events.
s.Require().Len(evts, 2)
s.Require().Equal(evts[0], evtParamToCheck{19, 2, 2100, gov.CRS(19)})
s.Require().Equal(evts[1], evtParamToCheck{20, 0, 2200, gov.CRS(20)})
// Round might exceed round-shift limitation would not be triggered.
- rEvt.ValidateNextRound(2280)
+ s.Require().Equal(rEvt.ValidateNextRound(2280), uint(1))
s.Require().Len(evts, 3)
s.Require().Equal(evts[2], evtParamToCheck{21, 0, 2300, gov.CRS(21)})
- rEvt.ValidateNextRound(2380)
+ s.Require().Equal(rEvt.ValidateNextRound(2380), uint(1))
s.Require().Equal(evts[3], evtParamToCheck{22, 0, 2400, gov.CRS(22)})
}