diff --git a/src/providers/tree/BaseTree.ts b/src/providers/tree/BaseTree.ts index 772a25a..7d7fdea 100644 --- a/src/providers/tree/BaseTree.ts +++ b/src/providers/tree/BaseTree.ts @@ -393,83 +393,5 @@ export class BaseTree { diffRecipients, negativeDiffs, }; - - // overridenConsole.log('Stats per Campaign:\n'); - // overridenConsole.table( - // Object.keys(statsPerCampaign) - // ?.filter((c) => statsPerCampaign[c].diff !== '0') - // .map((campaignId) => { - // const decimalsRewardToken = campaigns[campaignId].campaignParameters.decimalsRewardToken; - // return { - // campaignId: sliceCampaignId(campaignId), - // solidityIndex: getSolidityIndex(campaigns[campaignId].index), - // token: campaigns[campaignId].campaignParameters.symbolRewardToken, - // diff: displayString(statsPerCampaign[campaignId].diff, decimalsRewardToken), - // total: displayString(statsPerCampaign[campaignId].total, decimalsRewardToken), - // remainer: displayString(subStrings(campaigns[campaignId].amount, statsPerCampaign[campaignId].total), decimalsRewardToken), - // ['% done']: ( - // BigNumber.from(statsPerCampaign[campaignId].total).mul(BASE_9).div(campaigns[campaignId].amount).toNumber() / 1e7 - // ).toFixed(6), - // ['% time done']: ( - // ((statsPerCampaign[campaignId].lastProcessedTimestamp - campaigns[campaignId].startTimestamp) / - // (campaigns[campaignId].endTimestamp - campaigns[campaignId].startTimestamp)) * - // 100 - // ).toFixed(6), - // ['recipients/reasons']: statsPerCampaign[campaignId]['recipients/reasons'], - // }; - // }) - // ); - - // overridenConsole.log('\n\nStats per Recipient:\n'); - // overridenConsole.table( - // diffTree.data - // .filter((d) => d.amount !== '0') - // .map((x) => { - // return { - // campaignId: sliceCampaignId(x.campaignId), - // recipient: x.recipient, - // reason: x.reason, - // diff: displayString(x.amount, campaigns[x.campaignId].campaignParameters.decimalsRewardToken), - // total: displayString( - // newTree.data[newTree.findIndex(x.campaignId, x.recipient, x.reason).index].amount, - // campaigns[x.campaignId].campaignParameters.decimalsRewardToken - // ), - // token: campaigns[x.campaignId].campaignParameters.symbolRewardToken, - // percentage: ((parseFloat(x.amount) * 100) / parseFloat(statsPerCampaign[x.campaignId].diff)).toFixed(6), - // }; - // }) - // ); - // return (overridenConsoleRead.read() || '').toString(); - } - - public generateReport(): string { - const statsPerCampaign: { [campaignId: string]: { total: string } } = {}; - for (const campaignId of this.campaignIds()) { - const campaignInfo = this.campaignInfo(campaignId); - - statsPerCampaign[campaignId] = { total: campaignInfo.totalAmount }; - } - - overridenConsole.log('Stats per Campaign:\n'); - overridenConsole.table( - Object.keys(statsPerCampaign).map((campaignId) => { - return { - campaignId, - total: statsPerCampaign[campaignId].total, - }; - }) - ); - overridenConsole.log('\n\nStats per Recipient:\n'); - overridenConsole.table( - this.data.map((x) => { - return { - campaignId: x.campaignId, - recipient: x.recipient, - reason: x.reason, - amount: x.amount, - }; - }) - ); - return (overridenConsoleRead.read() || '').toString(); } }