From e5e106c50f3936697d1559c6695f6cb9d552c404 Mon Sep 17 00:00:00 2001 From: Roshaan Siddiqui Date: Wed, 31 May 2023 16:41:00 -0400 Subject: [PATCH] style: remove debug console logs --- frontend/src/components/Editor/Editor.js | 4 --- frontend/src/utils/indexerRunner.js | 45 ------------------------ 2 files changed, 49 deletions(-) diff --git a/frontend/src/components/Editor/Editor.js b/frontend/src/components/Editor/Editor.js index f62106a98..2dd473c12 100644 --- a/frontend/src/components/Editor/Editor.js +++ b/frontend/src/components/Editor/Editor.js @@ -312,13 +312,10 @@ const Editor = ({ async function executeIndexerFunction(option = "latest", startingBlockHeight = null) { switch (option) { case "selected": - console.log("executing selected") await indexerRunner.executeIndexerFunctionOnHeights(heights, indexingCode, option) break case "specific": - console.log("executing indexer specific") setIsExecutingIndexerFunction(() => true) - console.log(startingBlockHeight, "block hegihth stating") if (startingBlockHeight === null && Number(startingBlockHeight) === 0) { console.log("Invalid Starting Block Height: starting block height is null or 0") break @@ -327,7 +324,6 @@ const Editor = ({ await indexerRunner.start(startingBlockHeight, indexingCode, option) break case "latest": - console.log("executing indexer func") setIsExecutingIndexerFunction(() => true) await indexerRunner.start(height, indexingCode, option) const latestHeight = await requestLatestBlockHeight() diff --git a/frontend/src/utils/indexerRunner.js b/frontend/src/utils/indexerRunner.js index 1db28cd7f..debd12068 100644 --- a/frontend/src/utils/indexerRunner.js +++ b/frontend/src/utils/indexerRunner.js @@ -45,14 +45,12 @@ export default class IndexerRunner { } } - // Call this method to signal the block processing loop to stop stop() { this.shouldStop = true; console.log("%c Stopping Block Processing", 'color: white; background-color: red; padding: 5px;') } delay(ms) { - // this.stop() return new Promise((resolve) => setTimeout(resolve, ms)); } @@ -64,9 +62,7 @@ export default class IndexerRunner { block.receipts() block.events() - // console.group("Block Details") console.log(block) - // console.groupEnd() await this.runFunction(blockDetails, height, innerCode); } } @@ -79,7 +75,6 @@ export default class IndexerRunner { return } console.log("Note: GraphQL Mutations & Queries will not be executed on your database. They will simply return an empty object. Please keep this in mind as this may cause unintended behavior of your indexer function.") - // for loop with await for await (const height of heights) { console.group(`Block Height #${height}`) let blockDetails; @@ -158,7 +153,6 @@ export default class IndexerRunner { }, }; - // Call the wrapped function, passing the imported Block and streamerMessage wrappedFunction(Block, streamerMessage, context); } @@ -183,45 +177,6 @@ export default class IndexerRunner { ); } - // async runGraphQLQuery( - // operation, - // variables, - // function_name, - // block_height, - // hasuraRoleName, - // logError = true - // ) { - // const response = await this.deps.fetch( - // `${process.env.HASURA_ENDPOINT}/v1/graphql`, - // { - // method: "POST", - // headers: { - // "Content-Type": "application/json", - // ...(hasuraRoleName && { "X-Hasura-Role": hasuraRoleName }), - // }, - // body: JSON.stringify({ - // query: operation, - // ...(variables && { variables }), - // }), - // } - // ); - // - // const { data, errors } = await response.json(); - // - // if (response.status !== 200 || errors) { - // if (logError) { - // } - // throw new Error( - // `Failed to write graphql, http status: ${ - // response.status - // }, errors: ${JSON.stringify(errors, null, 2)}` - // ); - // } - // - // return data; - // } - // - renameUnderscoreFieldsToCamelCase(value) { if (value && typeof value === "object" && !Array.isArray(value)) { // It's a non-null, non-array object, create a replacement with the keys initially-capped