Create contributions instead of proposals

This commit is contained in:
2019-04-05 19:44:01 +02:00
parent 8cfbc222fc
commit f39bd41098
4 changed files with 35 additions and 28 deletions

View File

@@ -121,6 +121,7 @@ module.exports = async function(robot) {
ethProvider.resetEventsBlock(nextBlock);
Proposal.on('ProposalCreated', handleProposalCreated);
Contribution.on('ContributionAdded', handleContributionAdded);
});
}
@@ -133,6 +134,14 @@ module.exports = async function(robot) {
});
}
function handleContributionAdded(contributionId, contributorId, amount) {
Contributor.getById(contributorId).then((contributor) => {
Contribution.getById(contributionId).then((contribution) => {
robot.logger.debug(`[hubot-kredits] Contribution #${contribution.id} added (${contribution.description})`);
});
});
}
watchContractEvents();
//