Skip to content

Commit

Permalink
Adapt LedgerTransactionReader to support seeking and on-the-fly reads
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Apr 15, 2024
1 parent 49c2adc commit 07a9d40
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 378 deletions.
133 changes: 0 additions & 133 deletions ingest/lazy_transaction_reader.go

This file was deleted.

188 changes: 0 additions & 188 deletions ingest/lazy_transaction_reader_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions ingest/ledger_change_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (r *LedgerChangeReader) Read() (Change, error) {
}
return r.Read()
case evictionChangesState:
entries, err := r.ledgerCloseMeta.EvictedPersistentLedgerEntries()
entries, err := r.lcm.EvictedPersistentLedgerEntries()
if err != nil {
return Change{}, err
}
Expand All @@ -196,9 +196,9 @@ func (r *LedgerChangeReader) Read() (Change, error) {
return r.Read()
case upgradeChangesState:
// Get upgrade changes
if r.upgradeIndex < len(r.LedgerTransactionReader.ledgerCloseMeta.UpgradesProcessing()) {
if r.upgradeIndex < len(r.LedgerTransactionReader.lcm.UpgradesProcessing()) {
changes := GetChangesFromLedgerEntryChanges(
r.LedgerTransactionReader.ledgerCloseMeta.UpgradesProcessing()[r.upgradeIndex].Changes,
r.LedgerTransactionReader.lcm.UpgradesProcessing()[r.upgradeIndex].Changes,
)
r.pending = append(r.pending, changes...)
r.upgradeIndex++
Expand Down
Loading

0 comments on commit 07a9d40

Please sign in to comment.