comments and cleanup

This commit is contained in:
Ethan Buchman
2017-04-18 21:28:10 -04:00
parent 5109746b1c
commit 935f70a346
4 changed files with 26 additions and 27 deletions
+1 -9
View File
@@ -88,19 +88,14 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo
return nil, err
}
fail.Fail() // XXX
// Run txs of block
for _, tx := range block.Txs {
fail.FailRand(len(block.Txs)) // XXX
proxyAppConn.DeliverTxAsync(tx)
if err := proxyAppConn.Error(); err != nil {
return nil, err
}
}
fail.Fail() // XXX
// End block
abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(uint64(block.Height))
if err != nil {
@@ -108,8 +103,6 @@ func execBlockOnProxyApp(eventCache types.Fireable, proxyAppConn proxy.AppConnCo
return nil, err
}
fail.Fail() // XXX
valDiff := abciResponses.EndBlock.Diffs
log.Info("Executed block", "height", block.Height, "valid txs", validTxs, "invalid txs", invalidTxs)
@@ -292,9 +285,8 @@ func (s *State) indexTxs(abciResponses *ABCIResponses) {
s.TxIndexer.Batch(batch)
}
// Apply and commit a block, but without all the state validation.
// Apply and commit a block on the proxyApp without validating or mutating the state
// Returns the application root hash (result of abci.Commit)
// TODO handle abciResponses
func ApplyBlock(appConnConsensus proxy.AppConnConsensus, block *types.Block) ([]byte, error) {
var eventCache types.Fireable // nil
_, err := execBlockOnProxyApp(eventCache, appConnConsensus, block)
+1 -1
View File
@@ -186,7 +186,7 @@ type ABCIResponses struct {
DeliverTx []*abci.ResponseDeliverTx
EndBlock abci.ResponseEndBlock
txs types.Txs // for reference later
txs types.Txs // reference for indexing results by hash
}
func NewABCIResponses(block *types.Block) *ABCIResponses {