From 9878eb0f50f8819a2a8522bda4a7ae3f001a60a3 Mon Sep 17 00:00:00 2001 From: Nikhil Kumar <48001923+nikhilkumar1612@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:35:24 +0530 Subject: [PATCH] fix for whitelisting (#189) --- backend/src/routes/whitelist-routes.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/backend/src/routes/whitelist-routes.ts b/backend/src/routes/whitelist-routes.ts index 59a7073..e27cd73 100644 --- a/backend/src/routes/whitelist-routes.ts +++ b/backend/src/routes/whitelist-routes.ts @@ -47,7 +47,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => { policyId = body.params?.[1]; api_key = query['apiKey'] ?? body.params?.[2]; } - if (!address || !ethers.utils.isAddress(address)) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA }) if (!api_key || typeof(api_key) !== "string") return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY }) let privateKey = ''; @@ -154,7 +153,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => { chainId = query['chainId'] ?? body.params?.[2]; api_key = query['apiKey'] ?? body.params?.[3]; } - if (!address || !ethers.utils.isAddress(address)) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA }); if (!api_key || typeof(api_key) !== "string") return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY }) let privateKey = ''; @@ -346,9 +344,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => { if (!body) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.MISSING_PARAMS }); const address = body.params?.[0]; const policyId = body.params?.[1]; - if (!address || !ethers.utils.isAddress(address)) { - return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA }); - } const api_key = query['apiKey'] ?? body.params?.[2]; if (!api_key || typeof(api_key) !== "string") return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY }) @@ -428,9 +423,6 @@ const whitelistRoutes: FastifyPluginAsync = async (server) => { const policyId = body.params?.[1]; const chainId = query['chainId'] ?? body.params?.[2]; const api_key = query['apiKey'] ?? body.params?.[3]; - if (!address || !ethers.utils.isAddress(address)) { - return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_DATA }); - } if (!api_key || typeof(api_key) !== "string") return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.INVALID_API_KEY }) let privateKey = '';