From 1835c879df5508ec2bcd7bcd11e7871c8656335c Mon Sep 17 00:00:00 2001 From: Jordi Montes Date: Sat, 20 Jan 2018 13:51:57 +0100 Subject: [PATCH] FIXED: minor syntax changes --- bot/{main.js => index.js} | 16 ++++++++++------ package.json | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) rename bot/{main.js => index.js} (80%) diff --git a/bot/main.js b/bot/index.js similarity index 80% rename from bot/main.js rename to bot/index.js index c495a63..020fa4b 100644 --- a/bot/main.js +++ b/bot/index.js @@ -2,7 +2,7 @@ const SignerProvider = require('ethjs-provider-signer'); const sign = require('ethjs-signer').sign; const Eth = require('ethjs-query'); const Prices = require('./prices'); -const Config = require('./config'); +const Config = require('../config'); const provider = new SignerProvider(Config.signerPath, { @@ -12,6 +12,10 @@ const provider = new SignerProvider(Config.signerPath, { const eth = new Eth(provider); +const labels = { + +} + const needsFunding = function(req) { if (req.action !== 'created' || !req.hasOwnProperty('comment')) return false @@ -27,7 +31,7 @@ const getAddress = function(req) { } const getLabel = function(req){ - return "XS"; + } const getAmount = function(req) { @@ -37,8 +41,8 @@ const getAmount = function(req) { let amountToPayDollar = config.priceHour * config.workHours[label]; tokenPricePromise - .then((tokenPrice) => return tokenPrice * config.amountToPayInDollars ) - .catch((err) => console.log("TODO-ERROR: Failed token price request throw log error"); + .then((tokenPrice) => {return tokenPrice * config.amountToPayInDollars} ) + .catch((err) => {console.log("TODO-ERROR: Failed token price request throw log error")}); // Check how to handle errors when promises does not arrive } @@ -47,8 +51,8 @@ const getGasPrice = function(req) { let gasPricePromise = Prices.getGasPrice(); gasPricePromise - .then((gasPrice) => return gasPrice) - .catch((err) => console.log("TODO-ERROR: Failed gas price request throw log error"); + .then((gasPrice) => {return gasPrice}) + .catch((err) => {console.log("TODO-ERROR: Failed gas price request throw log error")}); // Check how to handle errors when promises does not arrive } diff --git a/package.json b/package.json index 745af5d..956ddaf 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "ethjs-query": "^0.2.4", "ethjs-signer": "^0.1.1", "express": "^4.15.2", + "helmet": "^3.9.0", "lodash": "^4.17.4", "web3": "^0.18.2" }