Skip to content

Commit

Permalink
Merge branch 'feat/ics20-v2-path-forwarding' into gjermund/6561-use-a…
Browse files Browse the repository at this point in the history
…-transfer-module-account-as-an-intermediary-address-for-forwards
  • Loading branch information
gjermundgaraba authored Jun 25, 2024
2 parents 4741ab0 + 74088ba commit e626e94
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit e626e94

Please sign in to comment.