Replace deprecated contract API calls #61
@ -1,5 +1,4 @@
|
||||
const util = require('util');
|
||||
const fetch = require('node-fetch');
|
||||
const amountFromLabels = require('./utils/amount-from-labels');
|
||||
const kindFromLabels = require('./utils/kind-from-labels');
|
||||
|
||||
@ -56,7 +55,7 @@ module.exports = async function(robot, kredits) {
|
||||
robot.logger.debug(`[hubot-kredits] contribution attributes:`);
|
||||
robot.logger.debug(util.inspect(contributionAttr, { depth: 1, colors: true }));
|
||||
|
||||
return Contribution.addContribution(contributionAttr).catch(error => {
|
||||
return Contribution.add(contributionAttr).catch(error => {
|
||||
robot.logger.error(`[hubot-kredits] Error:`, error);
|
||||
messageRoom(`I tried to add a contribution for ${giteaUser} for ${url}, but I encountered an error when submitting the tx:`);
|
||||
messageRoom(error.message);
|
||||
|
@ -61,7 +61,7 @@ module.exports = async function(robot, kredits) {
|
||||
robot.logger.debug(`[hubot-kredits] contribution attributes:`);
|
||||
robot.logger.debug(util.inspect(contributionAttr, { depth: 1, colors: true }));
|
||||
|
||||
return Contribution.addContribution(contributionAttr).catch(error => {
|
||||
return Contribution.add(contributionAttr).catch(error => {
|
||||
robot.logger.error(`[hubot-kredits] Error:`, error);
|
||||
messageRoom(`I tried to add a contribution for ${githubUser} for ${url}, but I encountered an error when submitting the tx:`);
|
||||
messageRoom(error.message);
|
||||
|
@ -48,7 +48,7 @@ module.exports = async function(robot, kredits) {
|
||||
kind: 'docs'
|
||||
};
|
||||
|
||||
return Contribution.addContribution(contribution).catch(error => {
|
||||
return Contribution.add(contribution).catch(error => {
|
||||
robot.logger.error(`[hubot-kredits] Adding contribution failed:`, error);
|
||||
});
|
||||
}).catch(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user