Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Oct 5, 2023
1 parent 4a94d3b commit 48fc0e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ingest/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func GetChangesFromLedgerEntryChanges(ledgerEntryChanges xdr.LedgerEntryChanges)
}
}

return sortChanges(changes)
sortChanges(changes)
return changes
}

type sortableChanges struct {
Expand Down Expand Up @@ -118,9 +119,8 @@ func (s sortableChanges) Swap(i, j int) {
// multiple changes with the same ledger key in a LedgerEntryChanges group,
// but if that is the case, we fall back to the original ordering of the changes
// by using a stable sorting algorithm.
func sortChanges(changes []Change) []Change {
func sortChanges(changes []Change) {
sort.Stable(newSortableChanges(changes))
return changes
}

// LedgerEntryChangeType returns type in terms of LedgerEntryChangeType.
Expand Down
2 changes: 1 addition & 1 deletion ingest/ledger_change_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (r *LedgerChangeReader) Read() (Change, error) {
Post: nil,
}
}
changes = sortChanges(changes)
sortChanges(changes)
r.pending = append(r.pending, changes...)
r.state++
return r.Read()
Expand Down
4 changes: 4 additions & 0 deletions services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

## 2.27.0

### Fixed
- Ordering of effects are now deterministic. Previously the order of some Horizon effects could vary upon reingestion but this issue has now been fixed ([5070](https://github.com/stellar/go/pull/5070)).

## 2.27.0-rc2
### Fixed
Expand Down

0 comments on commit 48fc0e8

Please sign in to comment.