diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-03-22 14:04:30 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-22 14:04:30 +0800 |
commit | 49c47180328c06eaeaca9176c2819b55bd75464f (patch) | |
tree | f374aaa06404b9054ef85e0a9088900db7bbfce7 /core/test/app.go | |
parent | 672d245243b6b85040f96e6638628b86975e9a1b (diff) | |
download | dexon-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.go')
-rw-r--r-- | core/test/app.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/core/test/app.go b/core/test/app.go index 12b2047..d704698 100644 --- a/core/test/app.go +++ b/core/test/app.go @@ -108,18 +108,13 @@ func NewApp(initRound uint64, gov *Governance, rEvt *utils.RoundEvent) ( app.state = gov.State() } if rEvt != nil { - app.hEvt.RegisterHeight( - utils.GetNextRoundValidationHeight(rEvt.LastPeriod()), - func(h uint64) { - rEvt.ValidateNextRound(h) - }) rEvt.Register(func(evts []utils.RoundEventParam) { app.hEvt.RegisterHeight( evts[len(evts)-1].NextRoundValidationHeight(), - func(h uint64) { - rEvt.ValidateNextRound(h) - }) + utils.RoundEventRetryHandlerGenerator(rEvt, app.hEvt), + ) }) + rEvt.TriggerInitEvent() } return app } @@ -265,7 +260,7 @@ func (app *App) BlockDelivered(blockHash common.Hash, pos types.Position, } } }() - go app.hEvt.NotifyHeight(result.Height) + app.hEvt.NotifyHeight(result.Height) } // GetLatestDeliveredPosition would return the latest position of delivered |