Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Feb 16, 2024
1 parent ade8870 commit 4e2adf8
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions src/providers/tree/BaseTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 4e2adf8

Please sign in to comment.