FIXED: minor syntax changes

This commit is contained in:
Jordi Montes 2018-01-20 13:51:57 +01:00
parent 323003f902
commit 1835c879df
2 changed files with 11 additions and 6 deletions

View File

@ -2,7 +2,7 @@ const SignerProvider = require('ethjs-provider-signer');
const sign = require('ethjs-signer').sign; const sign = require('ethjs-signer').sign;
const Eth = require('ethjs-query'); const Eth = require('ethjs-query');
const Prices = require('./prices'); const Prices = require('./prices');
const Config = require('./config'); const Config = require('../config');
const provider = new SignerProvider(Config.signerPath, { const provider = new SignerProvider(Config.signerPath, {
@ -12,6 +12,10 @@ const provider = new SignerProvider(Config.signerPath, {
const eth = new Eth(provider); const eth = new Eth(provider);
const labels = {
}
const needsFunding = function(req) { const needsFunding = function(req) {
if (req.action !== 'created' || !req.hasOwnProperty('comment')) if (req.action !== 'created' || !req.hasOwnProperty('comment'))
return false return false
@ -27,7 +31,7 @@ const getAddress = function(req) {
} }
const getLabel = function(req){ const getLabel = function(req){
return "XS";
} }
const getAmount = function(req) { const getAmount = function(req) {
@ -37,8 +41,8 @@ const getAmount = function(req) {
let amountToPayDollar = config.priceHour * config.workHours[label]; let amountToPayDollar = config.priceHour * config.workHours[label];
tokenPricePromise tokenPricePromise
.then((tokenPrice) => return tokenPrice * config.amountToPayInDollars ) .then((tokenPrice) => {return tokenPrice * config.amountToPayInDollars} )
.catch((err) => console.log("TODO-ERROR: Failed token price request throw log error"); .catch((err) => {console.log("TODO-ERROR: Failed token price request throw log error")});
// Check how to handle errors when promises does not arrive // Check how to handle errors when promises does not arrive
} }
@ -47,8 +51,8 @@ const getGasPrice = function(req) {
let gasPricePromise = Prices.getGasPrice(); let gasPricePromise = Prices.getGasPrice();
gasPricePromise gasPricePromise
.then((gasPrice) => return gasPrice) .then((gasPrice) => {return gasPrice})
.catch((err) => console.log("TODO-ERROR: Failed gas price request throw log error"); .catch((err) => {console.log("TODO-ERROR: Failed gas price request throw log error")});
// Check how to handle errors when promises does not arrive // Check how to handle errors when promises does not arrive
} }

View File

@ -17,6 +17,7 @@
"ethjs-query": "^0.2.4", "ethjs-query": "^0.2.4",
"ethjs-signer": "^0.1.1", "ethjs-signer": "^0.1.1",
"express": "^4.15.2", "express": "^4.15.2",
"helmet": "^3.9.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"web3": "^0.18.2" "web3": "^0.18.2"
} }