Skip to content
Merged
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
7 changes: 5 additions & 2 deletions modules/apps/transfer/types/transfer_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"context"
"math/big"
"reflect"
"slices"
"strings"

Expand Down Expand Up @@ -189,8 +188,12 @@ func isAllowedForwarding(hops []Hop, allowed []Hops) bool {
return true
}

// We want to ensure that at least one of the Hops in "allowed"
// is equal to "hops".
// Note that we can't use slices.Contains() as that is a generic
// function that requires the type Hop to satisfy the "comparable" constraint.
for _, allowedHops := range allowed {
if reflect.DeepEqual(hops, allowedHops.Hops) {
if slices.Equal(hops, allowedHops.Hops) {
return true
}
}
Expand Down