aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/app_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 /core/test/app_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 'core/test/app_test.go')
-rw-r--r--core/test/app_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/test/app_test.go b/core/test/app_test.go
index 138f803..e06b758 100644
--- a/core/test/app_test.go
+++ b/core/test/app_test.go
@@ -309,7 +309,7 @@ func (s *AppTestSuite) TestAttachedWithRoundEvent() {
1900, 2019, core.ConfigRoundShift)
s.Require().NoError(err)
// Register a handler to collects triggered events.
- evts := make(chan evtParamToCheck, 2)
+ evts := make(chan evtParamToCheck, 3)
rEvt.Register(func(params []utils.RoundEventParam) {
for _, p := range params {
evts <- evtParamToCheck{
@@ -336,6 +336,7 @@ func (s *AppTestSuite) TestAttachedWithRoundEvent() {
// Deliver blocks from height=2020 to height=2081.
deliver(0, 0, 2019)
deliver(19, 2020, 2091)
+ s.Require().Equal(<-evts, evtParamToCheck{19, 1, 2000, gov.CRS(19)})
s.Require().Equal(<-evts, evtParamToCheck{19, 2, 2100, gov.CRS(19)})
s.Require().Equal(<-evts, evtParamToCheck{20, 0, 2200, gov.CRS(20)})
// Deliver blocks from height=2082 to height=2281.