mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
consolidate saveResults/SaveABCIResponses
This commit is contained in:
@ -52,25 +52,25 @@ func execBlockOnProxyApp(txEventPublisher types.TxEventPublisher, proxyAppConn p
|
||||
// TODO: make use of res.Log
|
||||
// TODO: make use of this info
|
||||
// Blocks may include invalid txs.
|
||||
// reqDeliverTx := req.(abci.RequestDeliverTx)
|
||||
txResult := r.DeliverTx
|
||||
if txResult.Code == abci.CodeTypeOK {
|
||||
txRes := r.DeliverTx
|
||||
if txRes.Code == abci.CodeTypeOK {
|
||||
validTxs++
|
||||
} else {
|
||||
logger.Debug("Invalid tx", "code", txResult.Code, "log", txResult.Log)
|
||||
logger.Debug("Invalid tx", "code", txRes.Code, "log", txRes.Log)
|
||||
invalidTxs++
|
||||
}
|
||||
|
||||
// NOTE: if we count we can access the tx from the block instead of
|
||||
// pulling it from the req
|
||||
tx := types.Tx(req.GetDeliverTx().Tx)
|
||||
txEventPublisher.PublishEventTx(types.EventDataTx{types.TxResult{
|
||||
Height: block.Height,
|
||||
Index: uint32(txIndex),
|
||||
Tx: types.Tx(req.GetDeliverTx().Tx),
|
||||
Result: *txResult,
|
||||
Tx: tx,
|
||||
Result: *txRes,
|
||||
}})
|
||||
|
||||
abciResponses.DeliverTx[txIndex] = txResult
|
||||
abciResponses.DeliverTx[txIndex] = txRes
|
||||
txIndex++
|
||||
}
|
||||
}
|
||||
@ -84,6 +84,8 @@ func execBlockOnProxyApp(txEventPublisher types.TxEventPublisher, proxyAppConn p
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: determine which validators were byzantine
|
||||
|
||||
// Begin block
|
||||
_, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{
|
||||
Hash: block.Hash(),
|
||||
@ -322,7 +324,7 @@ func (s *State) ApplyBlock(txEventPublisher types.TxEventPublisher, proxyAppConn
|
||||
fail.Fail() // XXX
|
||||
|
||||
// save the results before we commit
|
||||
s.SaveABCIResponses(abciResponses)
|
||||
s.SaveABCIResponses(block.Height, abciResponses)
|
||||
|
||||
fail.Fail() // XXX
|
||||
|
||||
|
Reference in New Issue
Block a user