From f8d78a5dc415c9e33e3b672e12796b7719a316d6 Mon Sep 17 00:00:00 2001 From: beer-1 Date: Fri, 29 Nov 2024 16:50:19 +0900 Subject: [PATCH] wait indexer to be ready --- indexer/abci_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indexer/abci_test.go b/indexer/abci_test.go index 960e0b6..b4982bd 100644 --- a/indexer/abci_test.go +++ b/indexer/abci_test.go @@ -5,6 +5,7 @@ import ( "math/big" "sync" "testing" + "time" "github.com/stretchr/testify/require" @@ -67,6 +68,9 @@ func Test_ListenFinalizeBlock_Subscribe(t *testing.T) { indexer := app.EVMIndexer() defer app.Close() + // wait indexer to be ready + time.Sleep(3 * time.Second) + blockChan, logsChan, pendChan := indexer.Subscribe() defer close(blockChan) defer close(logsChan) @@ -104,10 +108,6 @@ func Test_ListenFinalizeBlock_Subscribe(t *testing.T) { require.Equal(t, reqHeight, finalizeReq.Height) tests.CheckTxResult(t, finalizeRes.TxResults[0], true) - events := finalizeRes.TxResults[0].Events - createEvent := events[len(events)-3] - require.Equal(t, evmtypes.EventTypeContractCreated, createEvent.GetType()) - wg.Wait() done() }