mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
EventDataTypeNewBlockHeader
This commit is contained in:
+2
-1
@@ -1205,7 +1205,8 @@ func (cs *ConsensusState) finalizeCommit(height int) {
|
||||
|
||||
// Fire off event for new block.
|
||||
// TODO: Handle app failure. See #177
|
||||
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{&types.BlockHeader{block.Header}})
|
||||
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{block})
|
||||
cs.evsw.FireEvent(types.EventStringNewBlockHeader(), types.EventDataNewBlockHeader{block.Header})
|
||||
|
||||
// Create a copy of the state for staging
|
||||
stateCopy := cs.state.Copy()
|
||||
|
||||
@@ -491,7 +491,7 @@ func TestLockPOLRelock(t *testing.T) {
|
||||
proposalCh := subscribeToEvent(cs1.evsw, "tester", types.EventStringCompleteProposal(), 1)
|
||||
voteCh := subscribeToEvent(cs1.evsw, "tester", types.EventStringVote(), 1)
|
||||
newRoundCh := subscribeToEvent(cs1.evsw, "tester", types.EventStringNewRound(), 1)
|
||||
newBlockCh := subscribeToEvent(cs1.evsw, "tester", types.EventStringNewBlock(), 1)
|
||||
newBlockCh := subscribeToEvent(cs1.evsw, "tester", types.EventStringNewBlockHeader(), 1)
|
||||
|
||||
log.Debug("cs2 last round", "lr", cs2.PrivValidator.LastRound)
|
||||
|
||||
@@ -577,14 +577,14 @@ func TestLockPOLRelock(t *testing.T) {
|
||||
_, _ = <-voteCh, <-voteCh
|
||||
|
||||
be := <-newBlockCh
|
||||
b := be.(types.EventDataNewBlock)
|
||||
b := be.(types.EventDataNewBlockHeader)
|
||||
re = <-newRoundCh
|
||||
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||
if rs.Height != 2 {
|
||||
t.Fatal("Expected height to increment")
|
||||
}
|
||||
|
||||
if !bytes.Equal(b.Block.Header.Hash(), propBlockHash) {
|
||||
if !bytes.Equal(b.Header.Hash(), propBlockHash) {
|
||||
t.Fatal("Expected new block to be proposal block")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user