Skip to content

Commit

Permalink
Sort addresses and event hashes for jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
awfm9 committed Aug 26, 2022
1 parent b2cde4c commit 767b25c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions service/pipeline/creation_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"errors"
"fmt"
"math"
"sort"
"strings"

"github.com/google/uuid"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -189,10 +191,16 @@ func (c *CreationStage) execute(height uint64) error {
for address := range addressSet {
addresses = append(addresses, address)
}
sort.Slice(addresses, func(i int, j int) bool {
return strings.Compare(addresses[i], addresses[j]) < 0
})
hashes := make([]string, 0, len(hashSet))
for hash := range hashSet {
hashes = append(hashes, hash)
}
sort.Slice(hashes, func(i int, j int) bool {
return strings.Compare(hashes[i], hashes[j]) < 0
})
parsing := jobs.Parsing{
ID: uuid.NewString(),
ChainID: c.cfg.ChainID,
Expand Down

0 comments on commit 767b25c

Please sign in to comment.