Skip to content

Commit dc48833

Browse files
committed
fix access_test
1 parent 10ea9e0 commit dc48833

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

engine/access/access_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ func (suite *Suite) TestGetSealedTransaction() {
726726

727727
collectionIndexer, err := ingestioncollections.NewIndexer(
728728
suite.log,
729+
db,
729730
collectionExecutedMetric,
730731
suite.state,
731732
all.Blocks,
@@ -816,8 +817,8 @@ func (suite *Suite) TestGetSealedTransaction() {
816817

817818
// block until the collection is processed by the indexer
818819
require.Eventually(suite.T(), func() bool {
819-
isStored, err := collectionIndexer.IsCollectionInStorage(collection.ID())
820-
return isStored && err == nil
820+
_, err := collections.LightByID(collection.ID())
821+
return err == nil
821822
}, 1*time.Second, 10*time.Millisecond, "collection not indexed")
822823

823824
// 5. Client requests a transaction
@@ -984,6 +985,7 @@ func (suite *Suite) TestGetTransactionResult() {
984985

985986
collectionIndexer, err := ingestioncollections.NewIndexer(
986987
suite.log,
988+
db,
987989
collectionExecutedMetric,
988990
suite.state,
989991
all.Blocks,
@@ -1259,6 +1261,7 @@ func (suite *Suite) TestExecuteScript() {
12591261

12601262
collectionIndexer, err := ingestioncollections.NewIndexer(
12611263
suite.log,
1264+
db,
12621265
collectionExecutedMetric,
12631266
suite.state,
12641267
all.Blocks,

engine/access/ingestion/collections/syncer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,14 @@ func (s *Syncer) requestMissingCollections(ctx context.Context, forceSendRequest
212212
return fmt.Errorf("failed to get finalized block: %w", err)
213213
}
214214

215+
if lastFullBlockHeight >= lastFinalizedBlock.Height {
216+
return nil
217+
}
218+
215219
// only send requests if we are sufficiently behind the latest finalized block to avoid spamming
216220
// collection nodes with requests.
217221
shouldSendRequestsToNetwork := forceSendRequests
218-
if lastFullBlockHeight < lastFinalizedBlock.Height && (lastFinalizedBlock.Height-lastFullBlockHeight >= s.missingCollectionRequestThreshold) {
222+
if lastFinalizedBlock.Height-lastFullBlockHeight >= s.missingCollectionRequestThreshold {
219223
shouldSendRequestsToNetwork = true
220224
}
221225

0 commit comments

Comments
 (0)