Skip to content

Commit

Permalink
use collections contains (#4196)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
  • Loading branch information
Carlos Rodriguez and DimitrisJim authored Jul 28, 2023
1 parent 730aa16 commit 4e1e594
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions modules/core/02-client/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"strings"

"github.com/cosmos/ibc-go/v7/internal/collections"
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

Expand All @@ -29,12 +30,7 @@ func (p Params) Validate() error {

// IsAllowedClient checks if the given client type is registered on the allowlist.
func (p Params) IsAllowedClient(clientType string) bool {
for _, allowedClient := range p.AllowedClients {
if allowedClient == clientType {
return true
}
}
return false
return collections.Contains(clientType, p.AllowedClients)
}

// validateClients checks that the given clients are not blank.
Expand Down

0 comments on commit 4e1e594

Please sign in to comment.