mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-17 12:46:16 +00:00
This change set implements the most recent version of `FinalizeBlock`. # What does this change actually contain? * This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name. * The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock` * The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous. * Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across. * Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created. # Questions for reviewers * We store this [ABCIResponses](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/proto/tendermint/state/types.pb.go#L37) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable? * Similarly, this change is exposed via the RPC through [ResultBlockResults](https://github.com/tendermint/tendermint/blob/5721a13ab1f4479f9807f449f0bf5c536b9a05f2/rpc/coretypes/responses.go#L69) changing. Should we somehow shim or notify for this change? closes: #7658
47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package mock
|
|
|
|
import (
|
|
"context"
|
|
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
"github.com/tendermint/tendermint/internal/libs/clist"
|
|
"github.com/tendermint/tendermint/internal/mempool"
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
// Mempool is an empty implementation of a Mempool, useful for testing.
|
|
type Mempool struct{}
|
|
|
|
var _ Mempool = Mempool{}
|
|
|
|
func (Mempool) Lock() {}
|
|
func (Mempool) Unlock() {}
|
|
func (Mempool) Size() int { return 0 }
|
|
func (Mempool) CheckTx(context.Context, types.Tx, func(*abci.ResponseCheckTx), mempool.TxInfo) error {
|
|
return nil
|
|
}
|
|
func (Mempool) RemoveTxByKey(txKey types.TxKey) error { return nil }
|
|
func (Mempool) ReapMaxBytesMaxGas(_, _ int64) types.Txs { return types.Txs{} }
|
|
func (Mempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} }
|
|
func (Mempool) Update(
|
|
_ context.Context,
|
|
_ int64,
|
|
_ types.Txs,
|
|
_ []*abci.ExecTxResult,
|
|
_ mempool.PreCheckFunc,
|
|
_ mempool.PostCheckFunc,
|
|
) error {
|
|
return nil
|
|
}
|
|
func (Mempool) Flush() {}
|
|
func (Mempool) FlushAppConn(ctx context.Context) error { return nil }
|
|
func (Mempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) }
|
|
func (Mempool) EnableTxsAvailable() {}
|
|
func (Mempool) SizeBytes() int64 { return 0 }
|
|
|
|
func (Mempool) TxsFront() *clist.CElement { return nil }
|
|
func (Mempool) TxsWaitChan() <-chan struct{} { return nil }
|
|
|
|
func (Mempool) InitWAL() error { return nil }
|
|
func (Mempool) CloseWAL() {}
|