Skip to content

Commit

Permalink
style: remove debug console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
roshaans committed May 31, 2023
1 parent 180e9b5 commit e5e106c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
4 changes: 0 additions & 4 deletions frontend/src/components/Editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
45 changes: 0 additions & 45 deletions frontend/src/utils/indexerRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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);
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -158,7 +153,6 @@ export default class IndexerRunner {
},
};

// Call the wrapped function, passing the imported Block and streamerMessage
wrappedFunction(Block, streamerMessage, context);
}

Expand All @@ -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
Expand Down

0 comments on commit e5e106c

Please sign in to comment.