From 9627a78d0d8253db4edaf1d7d3030bd0a7b2349e Mon Sep 17 00:00:00 2001 From: mury12 Date: Tue, 19 Dec 2023 17:52:15 -0300 Subject: [PATCH] chore: removed clogs --- assets/javascripts/lib/karma-api-client.js | 4 ---- assets/javascripts/lib/voting-history/index.js | 1 - .../lib/voting-history/moonbeam/moonbeam.js | 12 +++--------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/assets/javascripts/lib/karma-api-client.js b/assets/javascripts/lib/karma-api-client.js index e9b0c49..fa7a7b8 100644 --- a/assets/javascripts/lib/karma-api-client.js +++ b/assets/javascripts/lib/karma-api-client.js @@ -112,15 +112,12 @@ class KarmaApiClient { * @returns {import('karma-score').ParsedProposal[]} */ #parseVotingSummary = (summary) => { - console.info('voting summary', summary) const { proposals, votes } = summary; const parsedVotes = []; votes.sort().forEach((vote) => { const [id, version] = vote.proposalId.split('-'); - console.log('id', id, 'version', version) const proposal = proposals.find(p => p.id === +id && p.version === version); - console.log('proposal', proposal) if (!proposal) { return; } @@ -143,7 +140,6 @@ class KarmaApiClient { * @returns {Promise */ async fetchVoteSummary() { - console.info('fetching voting summary') if (!['moonbeam', 'moonriver', 'moonbase'].includes(this.daoName.toLowerCase())) { return { proposals: [], votes: [] }; } diff --git a/assets/javascripts/lib/voting-history/index.js b/assets/javascripts/lib/voting-history/index.js index 0c1fbc6..dadbfdf 100644 --- a/assets/javascripts/lib/voting-history/index.js +++ b/assets/javascripts/lib/voting-history/index.js @@ -40,7 +40,6 @@ const VotingHistory = { const amount = this.shouldShowVotingHistory(ctx); if (['moonbeam', 'moonriver', 'moonbase'].includes(daoName.toLowerCase())) { - console.info('voting history for' + daoName) const votes = await moonriverFetcher(daoName, profile.address); return votes.slice(0, amount); } diff --git a/assets/javascripts/lib/voting-history/moonbeam/moonbeam.js b/assets/javascripts/lib/voting-history/moonbeam/moonbeam.js index 5262c57..a783434 100644 --- a/assets/javascripts/lib/voting-history/moonbeam/moonbeam.js +++ b/assets/javascripts/lib/voting-history/moonbeam/moonbeam.js @@ -54,12 +54,10 @@ function concatOnChainProposals(proposals, votes) { } async function proposalsWithMetadata(daoName) { - console.log('proposals with metadata') - const url = `https://dapp.karmahq.xyz/api/proposals?dao=${daoName?.toLowerCase()}&source=on-chain`; + const url = `https://delegate.moonbeam.network/api/proposals?dao=${daoName?.toLowerCase()}&source=on-chain`; const data = await fetch(url, { method: "GET", }).then(async (res) => await res.json()); - console.info('cu de saco', data) return data; } @@ -104,7 +102,6 @@ async function fetchOnChainVotes(daoName, address) { daoName = [daoName].flat()[0] const cli = new KarmaApiClient([daoName].flat()[0], address); const { votes, proposals: cachedProposals } = await cli.fetchVoteSummary(); - console.info('deu n vote', votes, cachedProposals) const voteList = votes.map(vote => ({ proposal: vote.proposalId.split('-')[0], @@ -117,7 +114,7 @@ async function fetchOnChainVotes(daoName, address) { return concatOnChainProposals(proposals, voteList); } } catch (error) { - console.info(error) + console.error(error) return []; } return []; @@ -127,14 +124,11 @@ export async function moonriverFetcher( daoName, address ) { - console.info('fetching moonriver') try { const votes = await fetchOnChainVotes(daoName, address); - console.info('deu vote', votes) return votes; } catch (error) { - console.info('deu error') - console.info(error) + console.error(error) return []; } }