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