Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Mar 21, 2024
1 parent b450f5f commit aa94af6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/horizon/internal/ingest/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ func TestTruncateIngestStateTables(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &history.Q{&db.Session{DB: tt.HorizonDB}}

ledgerEntries := generateRandomLedgerEntries(tt)
// insert ledger entries of all types into the DB
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
checkpointLedger := uint32(63)
changeProcessor := buildChangeProcessor(q, &ingest.StatsChangeProcessor{}, historyArchiveSource, checkpointLedger, "")
for _, change := range ingest.GetChangesFromLedgerEntryChanges(generateRandomLedgerEntries(tt)) {
for _, change := range ingest.GetChangesFromLedgerEntryChanges(ledgerEntries) {
tt.Assert.NoError(changeProcessor.ProcessChange(tt.Ctx, change))
}
tt.Assert.NoError(changeProcessor.Commit(tt.Ctx))
Expand All @@ -305,7 +306,7 @@ func TestTruncateIngestStateTables(t *testing.T) {
// reinsert the same ledger entries from before
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
changeProcessor = buildChangeProcessor(q, &ingest.StatsChangeProcessor{}, historyArchiveSource, checkpointLedger, "")
for _, change := range ingest.GetChangesFromLedgerEntryChanges(generateRandomLedgerEntries(tt)) {
for _, change := range ingest.GetChangesFromLedgerEntryChanges(ledgerEntries) {
tt.Assert.NoError(changeProcessor.ProcessChange(tt.Ctx, change))
}
// this should succeed if we cleared out the state tables properly
Expand Down

0 comments on commit aa94af6

Please sign in to comment.