mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-10 15:07:24 +00:00
* 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>
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package client_test
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/tendermint/tendermint/abci/example/kvstore"
|
|
"github.com/tendermint/tendermint/config"
|
|
"github.com/tendermint/tendermint/libs/log"
|
|
"github.com/tendermint/tendermint/libs/service"
|
|
rpctest "github.com/tendermint/tendermint/rpc/test"
|
|
)
|
|
|
|
func NodeSuite(t *testing.T, logger log.Logger) (service.Service, *config.Config) {
|
|
t.Helper()
|
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
|
conf, err := rpctest.CreateConfig(t, t.Name())
|
|
require.NoError(t, err)
|
|
|
|
// start a tendermint node in the background to test against
|
|
dir := t.TempDir()
|
|
app := kvstore.NewPersistentKVStoreApplication(logger, dir)
|
|
|
|
node, closer, err := rpctest.StartTendermint(ctx, conf, app, rpctest.SuppressStdout)
|
|
require.NoError(t, err)
|
|
t.Cleanup(func() {
|
|
cancel()
|
|
assert.NoError(t, closer(ctx))
|
|
assert.NoError(t, app.Close())
|
|
node.Wait()
|
|
_ = os.RemoveAll(dir)
|
|
})
|
|
return node, conf
|
|
}
|