Skip to content

Commit

Permalink
wait indexer to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 29, 2024
1 parent 9664743 commit f8d78a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions indexer/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"math/big"
"sync"
"testing"
"time"

"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit f8d78a5

Please sign in to comment.