Skip to content

Commit

Permalink
Fix prefetch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Aug 1, 2024
1 parent 1ad3360 commit 1216a57
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ledger/test/LedgerTxnTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,9 @@ TEST_CASE("LedgerTxnRoot prefetch classic entries", "[ledgertxn]")

UnorderedSet<LedgerKey> keysToPrefetch;
auto app = createTestApplication(clock, cfg);
auto ledgerVers = app->getLedgerManager()
.getLastClosedLedgerHeader()
.header.ledgerVersion;

auto& root = app->getLedgerTxnRoot();

Expand All @@ -2634,7 +2637,8 @@ TEST_CASE("LedgerTxnRoot prefetch classic entries", "[ledgertxn]")
{
std::vector<LedgerEntry> ledgerVect{entrySet.begin(),
entrySet.end()};
app->getBucketManager().addBatch(*app, 2, 20, {}, ledgerVect, {});
app->getBucketManager().addBatch(*app, 2, ledgerVers, {},
ledgerVect, {});
}
ltx.commit();

Expand Down Expand Up @@ -2860,10 +2864,14 @@ TEST_CASE("LedgerTxnRoot prefetch soroban entries", "[ledgertxn]")
ltx.eraseWithoutLoading(deadKey);

// Insert all entries into the database.
auto ledgerVers = app->getLedgerManager()
.getLastClosedLedgerHeader()
.header.ledgerVersion;
std::vector<LedgerEntry> ledgerVect{classicEntry, contractDataEntry,
TTLEntry};
std::vector<LedgerKey> deadKeyVect{deadKey};
app->getBucketManager().addBatch(*app, 2, 20, {}, ledgerVect, deadKeyVect);
app->getBucketManager().addBatch(*app, 2, ledgerVers, {}, ledgerVect,
deadKeyVect);
ltx.commit();

auto addTxn = [&](bool enoughQuota, std::vector<LedgerEntry> entries,
Expand Down

0 comments on commit 1216a57

Please sign in to comment.