Create contributions instead of proposals
This commit is contained in:
9
index.js
9
index.js
@@ -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();
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user