Browse Source

unwind client creator

pull/8067/head
tycho garen 3 years ago
parent
commit
21f93fa15e
13 changed files with 63 additions and 80 deletions
  1. +1
    -1
      internal/blocksync/reactor_test.go
  2. +6
    -7
      internal/mempool/mempool_test.go
  3. +18
    -18
      internal/proxy/app_conn_test.go
  4. +2
    -13
      internal/proxy/multi_app_conn_test.go
  5. +10
    -8
      internal/state/execution_test.go
  6. +0
    -9
      internal/state/helpers_test.go
  7. +10
    -6
      internal/state/validation_test.go
  8. +6
    -3
      node/node.go
  9. +3
    -3
      node/node_test.go
  10. +1
    -1
      node/public.go
  11. +1
    -1
      rpc/test/helpers.go
  12. +1
    -1
      test/e2e/node/main.go
  13. +4
    -9
      test/fuzz/mempool/checktx.go

+ 1
- 1
internal/blocksync/reactor_test.go View File

@ -109,7 +109,7 @@ func (rts *reactorTestSuite) addNode(
logger := log.TestingLogger() logger := log.TestingLogger()
rts.nodes = append(rts.nodes, nodeID) rts.nodes = append(rts.nodes, nodeID)
rts.app[nodeID] = proxy.New(abciclient.NewLocalCreator(&abci.BaseApplication{}), logger, proxy.NopMetrics())
rts.app[nodeID] = proxy.New(abciclient.NewLocalClient(logger, &abci.BaseApplication{}), logger, proxy.NopMetrics())
require.NoError(t, rts.app[nodeID].Start(ctx)) require.NoError(t, rts.app[nodeID].Start(ctx))
blockDB := dbm.NewMemDB() blockDB := dbm.NewMemDB()


+ 6
- 7
internal/mempool/mempool_test.go View File

@ -78,24 +78,23 @@ func setup(ctx context.Context, t testing.TB, cacheSize int, options ...TxMempoo
var cancel context.CancelFunc var cancel context.CancelFunc
ctx, cancel = context.WithCancel(ctx) ctx, cancel = context.WithCancel(ctx)
app := &application{kvstore.NewApplication()}
cc := abciclient.NewLocalCreator(app)
logger := log.TestingLogger() logger := log.TestingLogger()
app := &application{kvstore.NewApplication()}
conn := abciclient.NewLocalClient(logger, app)
cfg, err := config.ResetTestRoot(t.TempDir(), strings.ReplaceAll(t.Name(), "/", "|")) cfg, err := config.ResetTestRoot(t.TempDir(), strings.ReplaceAll(t.Name(), "/", "|"))
require.NoError(t, err) require.NoError(t, err)
cfg.Mempool.CacheSize = cacheSize cfg.Mempool.CacheSize = cacheSize
appConnMem, err := cc(logger)
require.NoError(t, err)
require.NoError(t, appConnMem.Start(ctx))
require.NoError(t, conn.Start(ctx))
t.Cleanup(func() { t.Cleanup(func() {
os.RemoveAll(cfg.RootDir) os.RemoveAll(cfg.RootDir)
cancel() cancel()
appConnMem.Wait()
conn.Wait()
}) })
return NewTxMempool(logger.With("test", t.Name()), cfg.Mempool, appConnMem, options...)
return NewTxMempool(logger.With("test", t.Name()), cfg.Mempool, conn, options...)
} }
func checkTxs(ctx context.Context, t *testing.T, txmp *TxMempool, numTxs int, peerID uint16) []testTx { func checkTxs(ctx context.Context, t *testing.T, txmp *TxMempool, numTxs int, peerID uint16) []testTx {


+ 18
- 18
internal/proxy/app_conn_test.go View File

@ -51,7 +51,10 @@ var SOCKET = "socket"
func TestEcho(t *testing.T) { func TestEcho(t *testing.T) {
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6)) sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6))
logger := log.TestingLogger() logger := log.TestingLogger()
clientCreator := abciclient.NewRemoteCreator(logger, sockPath, SOCKET, true)
client, err := abciclient.NewClient(logger, sockPath, SOCKET, true)
if err != nil {
t.Fatal(err)
}
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
@ -62,12 +65,9 @@ func TestEcho(t *testing.T) {
t.Cleanup(func() { cancel(); s.Wait() }) t.Cleanup(func() { cancel(); s.Wait() })
// Start client // Start client
cli, err := clientCreator(logger.With("module", "abci-client"))
require.NoError(t, err, "Error creating ABCI client:")
require.NoError(t, cli.Start(ctx), "Error starting ABCI client")
require.NoError(t, client.Start(ctx), "Error starting ABCI client")
proxy := newAppConnTest(cli)
proxy := newAppConnTest(client)
t.Log("Connected") t.Log("Connected")
for i := 0; i < 1000; i++ { for i := 0; i < 1000; i++ {
@ -91,7 +91,10 @@ func BenchmarkEcho(b *testing.B) {
b.StopTimer() // Initialize b.StopTimer() // Initialize
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6)) sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6))
logger := log.TestingLogger() logger := log.TestingLogger()
clientCreator := abciclient.NewRemoteCreator(logger, sockPath, SOCKET, true)
client, err := abciclient.NewClient(logger, sockPath, SOCKET, true)
if err != nil {
b.Fatal(err)
}
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
@ -102,12 +105,9 @@ func BenchmarkEcho(b *testing.B) {
b.Cleanup(func() { cancel(); s.Wait() }) b.Cleanup(func() { cancel(); s.Wait() })
// Start client // Start client
cli, err := clientCreator(logger.With("module", "abci-client"))
require.NoError(b, err, "Error creating ABCI client")
require.NoError(b, client.Start(ctx), "Error starting ABCI client")
require.NoError(b, cli.Start(ctx), "Error starting ABCI client")
proxy := newAppConnTest(cli)
proxy := newAppConnTest(client)
b.Log("Connected") b.Log("Connected")
echoString := strings.Repeat(" ", 200) echoString := strings.Repeat(" ", 200)
b.StartTimer() // Start benchmarking tests b.StartTimer() // Start benchmarking tests
@ -139,7 +139,10 @@ func TestInfo(t *testing.T) {
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6)) sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", tmrand.Str(6))
logger := log.TestingLogger() logger := log.TestingLogger()
clientCreator := abciclient.NewRemoteCreator(logger, sockPath, SOCKET, true)
client, err := abciclient.NewClient(logger, sockPath, SOCKET, true)
if err != nil {
t.Fatal(err)
}
// Start server // Start server
s := server.NewSocketServer(logger.With("module", "abci-server"), sockPath, kvstore.NewApplication()) s := server.NewSocketServer(logger.With("module", "abci-server"), sockPath, kvstore.NewApplication())
@ -147,12 +150,9 @@ func TestInfo(t *testing.T) {
t.Cleanup(func() { cancel(); s.Wait() }) t.Cleanup(func() { cancel(); s.Wait() })
// Start client // Start client
cli, err := clientCreator(logger.With("module", "abci-client"))
require.NoError(t, err, "Error creating ABCI client")
require.NoError(t, cli.Start(ctx), "Error starting ABCI client")
require.NoError(t, client.Start(ctx), "Error starting ABCI client")
proxy := newAppConnTest(cli)
proxy := newAppConnTest(client)
t.Log("Connected") t.Log("Connected")
resInfo, err := proxy.Info(ctx, RequestInfo) resInfo, err := proxy.Info(ctx, RequestInfo)


+ 2
- 13
internal/proxy/multi_app_conn_test.go View File

@ -36,13 +36,7 @@ func TestAppConns_Start_Stop(t *testing.T) {
clientMock.On("Wait").Return(nil).Times(1) clientMock.On("Wait").Return(nil).Times(1)
cl := &noopStoppableClientImpl{Client: clientMock} cl := &noopStoppableClientImpl{Client: clientMock}
creatorCallCount := 0
creator := func(logger log.Logger) (abciclient.Client, error) {
creatorCallCount++
return cl, nil
}
appConns := New(creator, log.TestingLogger(), NopMetrics())
appConns := New(cl, log.TestingLogger(), NopMetrics())
err := appConns.Start(ctx) err := appConns.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -54,7 +48,6 @@ func TestAppConns_Start_Stop(t *testing.T) {
clientMock.AssertExpectations(t) clientMock.AssertExpectations(t)
assert.Equal(t, 1, cl.count) assert.Equal(t, 1, cl.count)
assert.Equal(t, 1, creatorCallCount)
} }
// Upon failure, we call tmos.Kill // Upon failure, we call tmos.Kill
@ -80,11 +73,7 @@ func TestAppConns_Failure(t *testing.T) {
clientMock.On("Error").Return(errors.New("EOF")) clientMock.On("Error").Return(errors.New("EOF"))
cl := &noopStoppableClientImpl{Client: clientMock} cl := &noopStoppableClientImpl{Client: clientMock}
creator := func(log.Logger) (abciclient.Client, error) {
return cl, nil
}
appConns := New(creator, log.TestingLogger(), NopMetrics())
appConns := New(cl, log.TestingLogger(), NopMetrics())
err := appConns.Start(ctx) err := appConns.Start(ctx)
require.NoError(t, err) require.NoError(t, err)


+ 10
- 8
internal/state/execution_test.go View File

@ -39,8 +39,8 @@ var (
func TestApplyBlock(t *testing.T) { func TestApplyBlock(t *testing.T) {
app := &testApp{} app := &testApp{}
cc := abciclient.NewLocalCreator(app)
logger := log.TestingLogger() logger := log.TestingLogger()
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
@ -73,9 +73,10 @@ func TestBeginBlockValidators(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
logger := log.TestingLogger()
app := &testApp{} app := &testApp{}
cc := abciclient.NewLocalCreator(app)
proxyApp := proxy.New(cc, log.TestingLogger(), proxy.NopMetrics())
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx) err := proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -145,8 +146,9 @@ func TestBeginBlockByzantineValidators(t *testing.T) {
defer cancel() defer cancel()
app := &testApp{} app := &testApp{}
cc := abciclient.NewLocalCreator(app)
proxyApp := proxy.New(cc, log.TestingLogger(), proxy.NopMetrics())
logger := log.TestingLogger()
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx) err := proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -248,8 +250,8 @@ func TestProcessProposal(t *testing.T) {
defer cancel() defer cancel()
app := abcimocks.NewBaseMock() app := abcimocks.NewBaseMock()
cc := abciclient.NewLocalCreator(app)
logger := log.TestingLogger() logger := log.TestingLogger()
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx) err := proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -451,8 +453,8 @@ func TestEndBlockValidatorUpdates(t *testing.T) {
defer cancel() defer cancel()
app := &testApp{} app := &testApp{}
cc := abciclient.NewLocalCreator(app)
logger := log.TestingLogger() logger := log.TestingLogger()
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx) err := proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -526,8 +528,8 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {
defer cancel() defer cancel()
app := &testApp{} app := &testApp{}
cc := abciclient.NewLocalCreator(app)
logger := log.TestingLogger() logger := log.TestingLogger()
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx) err := proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)


+ 0
- 9
internal/state/helpers_test.go View File

@ -11,16 +11,13 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db" dbm "github.com/tendermint/tm-db"
abciclient "github.com/tendermint/tendermint/abci/client"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/encoding" "github.com/tendermint/tendermint/crypto/encoding"
"github.com/tendermint/tendermint/internal/proxy"
sm "github.com/tendermint/tendermint/internal/state" sm "github.com/tendermint/tendermint/internal/state"
sf "github.com/tendermint/tendermint/internal/state/test/factory" sf "github.com/tendermint/tendermint/internal/state/test/factory"
"github.com/tendermint/tendermint/internal/test/factory" "github.com/tendermint/tendermint/internal/test/factory"
"github.com/tendermint/tendermint/libs/log"
tmrand "github.com/tendermint/tendermint/libs/rand" tmrand "github.com/tendermint/tendermint/libs/rand"
tmtime "github.com/tendermint/tendermint/libs/time" tmtime "github.com/tendermint/tendermint/libs/time"
tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmstate "github.com/tendermint/tendermint/proto/tendermint/state"
@ -33,12 +30,6 @@ type paramsChangeTestCase struct {
params types.ConsensusParams params types.ConsensusParams
} }
func newTestApp() abciclient.Client {
app := &testApp{}
cc := abciclient.NewLocalCreator(app)
return proxy.New(cc, log.NewNopLogger(), proxy.NopMetrics())
}
func makeAndCommitGoodBlock( func makeAndCommitGoodBlock(
ctx context.Context, ctx context.Context,
t *testing.T, t *testing.T,


+ 10
- 6
internal/state/validation_test.go View File

@ -10,10 +10,12 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db" dbm "github.com/tendermint/tm-db"
abciclient "github.com/tendermint/tendermint/abci/client"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/tmhash" "github.com/tendermint/tendermint/crypto/tmhash"
memmock "github.com/tendermint/tendermint/internal/mempool/mock" memmock "github.com/tendermint/tendermint/internal/mempool/mock"
"github.com/tendermint/tendermint/internal/proxy"
sm "github.com/tendermint/tendermint/internal/state" sm "github.com/tendermint/tendermint/internal/state"
"github.com/tendermint/tendermint/internal/state/mocks" "github.com/tendermint/tendermint/internal/state/mocks"
statefactory "github.com/tendermint/tendermint/internal/state/test/factory" statefactory "github.com/tendermint/tendermint/internal/state/test/factory"
@ -30,8 +32,8 @@ const validationTestsStopHeight int64 = 10
func TestValidateBlockHeader(t *testing.T) { func TestValidateBlockHeader(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
proxyApp := newTestApp()
logger := log.TestingLogger()
proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics())
require.NoError(t, proxyApp.Start(ctx)) require.NoError(t, proxyApp.Start(ctx))
state, stateDB, privVals := makeState(t, 3, 1) state, stateDB, privVals := makeState(t, 3, 1)
@ -39,7 +41,7 @@ func TestValidateBlockHeader(t *testing.T) {
blockStore := store.NewBlockStore(dbm.NewMemDB()) blockStore := store.NewBlockStore(dbm.NewMemDB())
blockExec := sm.NewBlockExecutor( blockExec := sm.NewBlockExecutor(
stateStore, stateStore,
log.TestingLogger(),
logger,
proxyApp, proxyApp,
memmock.Mempool{}, memmock.Mempool{},
sm.EmptyEvidencePool{}, sm.EmptyEvidencePool{},
@ -119,7 +121,8 @@ func TestValidateBlockCommit(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
proxyApp := newTestApp()
logger := log.TestingLogger()
proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics())
require.NoError(t, proxyApp.Start(ctx)) require.NoError(t, proxyApp.Start(ctx))
state, stateDB, privVals := makeState(t, 1, 1) state, stateDB, privVals := makeState(t, 1, 1)
@ -127,7 +130,7 @@ func TestValidateBlockCommit(t *testing.T) {
blockStore := store.NewBlockStore(dbm.NewMemDB()) blockStore := store.NewBlockStore(dbm.NewMemDB())
blockExec := sm.NewBlockExecutor( blockExec := sm.NewBlockExecutor(
stateStore, stateStore,
log.TestingLogger(),
logger,
proxyApp, proxyApp,
memmock.Mempool{}, memmock.Mempool{},
sm.EmptyEvidencePool{}, sm.EmptyEvidencePool{},
@ -245,7 +248,8 @@ func TestValidateBlockEvidence(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
proxyApp := newTestApp()
logger := log.TestingLogger()
proxyApp := proxy.New(abciclient.NewLocalClient(logger, &testApp{}), logger, proxy.NopMetrics())
require.NoError(t, proxyApp.Start(ctx)) require.NoError(t, proxyApp.Start(ctx))
state, stateDB, privVals := makeState(t, 4, 1) state, stateDB, privVals := makeState(t, 4, 1)


+ 6
- 3
node/node.go View File

@ -100,7 +100,10 @@ func newDefaultNode(
return nil, err return nil, err
} }
appClient, _ := proxy.ClientFactory(logger, cfg.ProxyApp, cfg.ABCI, cfg.DBDir())
appClient, _, err := proxy.ClientFactory(logger, cfg.ProxyApp, cfg.ABCI, cfg.DBDir())
if err != nil {
return nil, err
}
return makeNode( return makeNode(
ctx, ctx,
@ -120,7 +123,7 @@ func makeNode(
cfg *config.Config, cfg *config.Config,
filePrivval *privval.FilePV, filePrivval *privval.FilePV,
nodeKey types.NodeKey, nodeKey types.NodeKey,
clientCreator abciclient.Creator,
client abciclient.Client,
genesisDocProvider genesisDocProvider, genesisDocProvider genesisDocProvider,
dbProvider config.DBProvider, dbProvider config.DBProvider,
logger log.Logger, logger log.Logger,
@ -155,7 +158,7 @@ func makeNode(
nodeMetrics := defaultMetricsProvider(cfg.Instrumentation)(genDoc.ChainID) nodeMetrics := defaultMetricsProvider(cfg.Instrumentation)(genDoc.ChainID)
// Create the proxyApp and establish connections to the ABCI app (consensus, mempool, query). // Create the proxyApp and establish connections to the ABCI app (consensus, mempool, query).
proxyApp := proxy.New(clientCreator, logger.With("module", "proxy"), nodeMetrics.proxy)
proxyApp := proxy.New(client, logger.With("module", "proxy"), nodeMetrics.proxy)
if err := proxyApp.Start(ctx); err != nil { if err := proxyApp.Start(ctx); err != nil {
return nil, fmt.Errorf("error starting proxy app connections: %w", err) return nil, fmt.Errorf("error starting proxy app connections: %w", err)
} }


+ 3
- 3
node/node_test.go View File

@ -273,7 +273,7 @@ func TestCreateProposalBlock(t *testing.T) {
logger := log.NewNopLogger() logger := log.NewNopLogger()
cc := abciclient.NewLocalCreator(kvstore.NewApplication())
cc := abciclient.NewLocalClient(logger, kvstore.NewApplication())
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err = proxyApp.Start(ctx) err = proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -371,7 +371,7 @@ func TestMaxTxsProposalBlockSize(t *testing.T) {
logger := log.NewNopLogger() logger := log.NewNopLogger()
cc := abciclient.NewLocalCreator(kvstore.NewApplication())
cc := abciclient.NewLocalClient(logger, kvstore.NewApplication())
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err = proxyApp.Start(ctx) err = proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)
@ -438,7 +438,7 @@ func TestMaxProposalBlockSize(t *testing.T) {
logger := log.NewNopLogger() logger := log.NewNopLogger()
cc := abciclient.NewLocalCreator(kvstore.NewApplication())
cc := abciclient.NewLocalClient(logger, kvstore.NewApplication())
proxyApp := proxy.New(cc, logger, proxy.NopMetrics()) proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err = proxyApp.Start(ctx) err = proxyApp.Start(ctx)
require.NoError(t, err) require.NoError(t, err)


+ 1
- 1
node/public.go View File

@ -35,7 +35,7 @@ func New(
ctx context.Context, ctx context.Context,
conf *config.Config, conf *config.Config,
logger log.Logger, logger log.Logger,
cf abciclient.Creator,
cf abciclient.Client,
gen *types.GenesisDoc, gen *types.GenesisDoc,
) (service.Service, error) { ) (service.Service, error) {
nodeKey, err := types.LoadOrGenNodeKey(conf.NodeKeyFile()) nodeKey, err := types.LoadOrGenNodeKey(conf.NodeKeyFile())


+ 1
- 1
rpc/test/helpers.go View File

@ -98,7 +98,7 @@ func StartTendermint(
} }
} }
papp := abciclient.NewLocalCreator(app)
papp := abciclient.NewLocalClient(logger, app)
tmNode, err := node.New(ctx, conf, logger, papp, nil) tmNode, err := node.New(ctx, conf, logger, papp, nil)
if err != nil { if err != nil {
return nil, func(_ context.Context) error { cancel(); return nil }, err return nil, func(_ context.Context) error { cancel(); return nil }, err


+ 1
- 1
test/e2e/node/main.go View File

@ -136,7 +136,7 @@ func startNode(ctx context.Context, cfg *Config) error {
ctx, ctx,
tmcfg, tmcfg,
nodeLogger, nodeLogger,
abciclient.NewLocalCreator(app),
abciclient.NewLocalClient(nodeLogger, app),
nil, nil,
) )
if err != nil { if err != nil {


+ 4
- 9
test/fuzz/mempool/checktx.go View File

@ -15,9 +15,9 @@ var getMp func() mempool.Mempool
func init() { func init() {
app := kvstore.NewApplication() app := kvstore.NewApplication()
cc := abciclient.NewLocalCreator(app)
appConnMem, _ := cc(log.NewNopLogger())
err := appConnMem.Start(context.TODO())
logger := log.NewNopLogger()
conn := abciclient.NewLocalClient(logger, app)
err := conn.Start(context.TODO())
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -27,12 +27,7 @@ func init() {
getMp = func() mempool.Mempool { getMp = func() mempool.Mempool {
if mp == nil { if mp == nil {
mp = mempool.NewTxMempool(
log.NewNopLogger(),
cfg,
appConnMem,
)
mp = mempool.NewTxMempool(logger, cfg, conn)
} }
return mp return mp
} }


Loading…
Cancel
Save