From 4e1e594063fab06b210c333493531dc80587c2ee Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Fri, 28 Jul 2023 08:46:54 +0200 Subject: [PATCH] use collections contains (#4196) Co-authored-by: Jim Fasarakis-Hilliard --- modules/core/02-client/types/params.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/core/02-client/types/params.go b/modules/core/02-client/types/params.go index 0f2f6b93229..e413586601b 100644 --- a/modules/core/02-client/types/params.go +++ b/modules/core/02-client/types/params.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" + "github.com/cosmos/ibc-go/v7/internal/collections" "github.com/cosmos/ibc-go/v7/modules/core/exported" ) @@ -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.