From a6c7f0ece6ca1fc21928bdaf2932f46d9bd2f8ea Mon Sep 17 00:00:00 2001 From: nnn-gif Date: Thu, 4 Jul 2024 16:46:40 +0530 Subject: [PATCH] Update api.go --- cmd/http/oraclebuilder/api.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/http/oraclebuilder/api.go b/cmd/http/oraclebuilder/api.go index 419caab46..865105077 100644 --- a/cmd/http/oraclebuilder/api.go +++ b/cmd/http/oraclebuilder/api.go @@ -318,7 +318,7 @@ func (ob *Env) SupportedChains(context *gin.Context) { for _, chainInfo := range chains { - if ob.SupportedChain == chainInfo.ChainID { + if contains(ob.SupportedChain, chainInfo.ChainID) { chainArray = append(chainArray, chainInfo.ChainID) } @@ -964,3 +964,12 @@ func (ob *Env) Auth(context *gin.Context) { } } + +func contains(arr []string, str string) bool { + for _, v := range arr { + if v == str { + return true + } + } + return false +}