Merge remote-tracking branch 'origin/consensus_tests' into develop

This commit is contained in:
Jae Kwon 2015-10-11 18:20:19 -07:00
commit 13e25ef164
3 changed files with 1183 additions and 4 deletions

View File

@ -1316,10 +1316,8 @@ func (cs *ConsensusState) saveBlock(block *types.Block, blockParts *types.PartSe
// Fire off event
if cs.evsw != nil && cs.evc != nil {
go func(block *types.Block) {
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{block})
cs.evc.Flush()
}(block)
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{block})
go cs.evc.Flush()
}
}

1177
consensus/state_test.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@ import (
bc "github.com/tendermint/tendermint/blockchain"
dbm "github.com/tendermint/tendermint/db"
"github.com/tendermint/tendermint/events"
mempl "github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/p2p"
sm "github.com/tendermint/tendermint/state"
@ -206,6 +207,9 @@ func simpleConsensusState(nValidators int) ([]*ConsensusState, []*types.PrivVali
cs := NewConsensusState(state, blockStore, mempoolReactor)
cs.SetPrivValidator(privVals[i])
evsw := events.NewEventSwitch()
cs.SetFireable(evsw)
// read off the NewHeightStep
<-cs.NewStepCh()