Skip to content

Commit

Permalink
fix: manual re-review
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jul 9, 2024
1 parent 4eddd43 commit b8fbd4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion core/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func TestExchange_DoNotStoreHistoric(t *testing.T) {
t.Cleanup(cancel)

cfg := DefaultTestConfig()
cfg.Genesis.ChainID = testChainID
fetcher, cctx := createCoreFetcher(t, cfg)

generateNonEmptyBlocks(t, ctx, fetcher, cfg, cctx)
Expand Down
1 change: 0 additions & 1 deletion core/listener_no_race_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func TestListenerWithNonEmptyBlocks(t *testing.T) {

// create one block to store as Head in local store and then unsubscribe from block events
cfg := DefaultTestConfig()
cfg.Genesis.ChainID = testChainID
fetcher, cctx := createCoreFetcher(t, cfg)
eds := createEdsPubSub(ctx, t)

Expand Down
8 changes: 8 additions & 0 deletions state/core_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/proto/tendermint/crypto"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials/insecure"

"github.com/celestiaorg/celestia-app/v2/app"
Expand Down Expand Up @@ -127,6 +128,13 @@ func (ca *CoreAccessor) Start(ctx context.Context) error {
if err != nil {
return err
}
// this ensures we can't start the node without core connection
client.Connect()
if !client.WaitForStateChange(ctx, connectivity.Ready) {
// hits the case when context is canceled
return fmt.Errorf("couldn't connect to core endpoint(%s): %w", endpoint, ctx.Err())
}

ca.coreConn = client

// create the staking query client
Expand Down

0 comments on commit b8fbd4b

Please sign in to comment.