Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/app/admin/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package admin
import (
"context"
"math/rand"
"sort"
"slices"

"github.com/omni-network/omni/contracts/bindings"
"github.com/omni-network/omni/e2e/app"
Expand Down Expand Up @@ -398,7 +398,7 @@ func randBridgeSpec() BridgeSpec {
}

func sortUint64(ns []uint64) {
sort.Slice(ns, func(i, j int) bool { return ns[i] < ns[j] })
slices.Sort(ns)
}

func randChain(chains []types.EVMChain) types.EVMChain {
Expand Down
6 changes: 2 additions & 4 deletions halo/registry/keeper/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keeper

import (
"context"
"sort"
"slices"
"sync"

"github.com/omni-network/omni/halo/registry/types"
Expand Down Expand Up @@ -72,9 +72,7 @@ func (k Keeper) ConfLevels(ctx context.Context) (map[uint64][]xchain.ConfLevel,
confLevels = append(confLevels, confLevel)
}

sort.Slice(confLevels, func(i, j int) bool {
return confLevels[i] < confLevels[j]
})
slices.Sort(confLevels)

resp[portal.GetChainId()] = confLevels
}
Expand Down
6 changes: 2 additions & 4 deletions lib/netconf/netconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package netconf

import (
"fmt"
"sort"
"slices"
"time"

"github.com/omni-network/omni/lib/errors"
Expand Down Expand Up @@ -385,9 +385,7 @@ func (c Chain) ConfLevels() []xchain.ConfLevel {
}

// Sort for deterministic ordering.
sort.Slice(confs, func(i, j int) bool {
return confs[i] < confs[j]
})
slices.Sort(confs)

return confs
}
Expand Down
6 changes: 2 additions & 4 deletions lib/netconf/network.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package netconf

import (
"sort"
"slices"

"github.com/omni-network/omni/lib/errors"
)
Expand Down Expand Up @@ -90,9 +90,7 @@ func All() []ID {
}
}

sort.Slice(resp, func(i, j int) bool {
return resp[i] < resp[j]
})
slices.Sort(resp)

return resp
}