mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
Completed the existing FinalizeBlock PR and rebased to master (#7798)
* Rebased and git-squashed the commits in PR #6546 migrate abci to finalizeBlock work on abci, proxy and mempool abciresponse, blok events, indexer, some tests fix some tests fix errors fix errors in abci fix tests amd errors * Fixes after rebasing PR#6546 * Restored height to RequestFinalizeBlock & other * Fixed more UTs * Fixed kvstore * More UT fixes * last TC fixed * make format * Update internal/consensus/mempool_test.go Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> * Addressed @williambanfield's comments * Fixed UTs * Addressed last comments from @williambanfield * make format Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
This commit is contained in:
co-authored by
William Banfield
marbar3778
parent
7e09c2ef43
commit
d3548eb706
+14
-11
@@ -145,24 +145,27 @@ func (app *Application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
|
||||
return abci.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1}
|
||||
}
|
||||
|
||||
// DeliverTx implements ABCI.
|
||||
func (app *Application) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
|
||||
key, value, err := parseTx(req.Tx)
|
||||
if err != nil {
|
||||
panic(err) // shouldn't happen since we verified it in CheckTx
|
||||
// FinalizeBlock implements ABCI.
|
||||
func (app *Application) FinalizeBlock(req abci.RequestFinalizeBlock) abci.ResponseFinalizeBlock {
|
||||
var txs = make([]*abci.ResponseDeliverTx, len(req.Txs))
|
||||
|
||||
for i, tx := range req.Txs {
|
||||
key, value, err := parseTx(tx)
|
||||
if err != nil {
|
||||
panic(err) // shouldn't happen since we verified it in CheckTx
|
||||
}
|
||||
app.state.Set(key, value)
|
||||
|
||||
txs[i] = &abci.ResponseDeliverTx{Code: code.CodeTypeOK}
|
||||
}
|
||||
app.state.Set(key, value)
|
||||
return abci.ResponseDeliverTx{Code: code.CodeTypeOK}
|
||||
}
|
||||
|
||||
// EndBlock implements ABCI.
|
||||
func (app *Application) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock {
|
||||
valUpdates, err := app.validatorUpdates(uint64(req.Height))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return abci.ResponseEndBlock{
|
||||
return abci.ResponseFinalizeBlock{
|
||||
Txs: txs,
|
||||
ValidatorUpdates: valUpdates,
|
||||
Events: []abci.Event{
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
mempool "github.com/tendermint/tendermint/test/fuzz/mempool"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/test/fuzz/p2p/secretconnection"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/test/fuzz/rpc/jsonrpc/server"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user