removed debug
This commit is contained in:
parent
b7a93b89f5
commit
fe1ed536c5
4 changed files with 1 additions and 18 deletions
|
|
@ -18,7 +18,6 @@ function post (tx, pi) {
|
||||||
const sql = 'select * from cash_in_txs where id=$1'
|
const sql = 'select * from cash_in_txs where id=$1'
|
||||||
const sql2 = 'select * from bills where cash_in_txs_id=$1'
|
const sql2 = 'select * from bills where cash_in_txs_id=$1'
|
||||||
|
|
||||||
console.log('DEBUG888: %j', tx)
|
|
||||||
return t.oneOrNone(sql, [tx.id])
|
return t.oneOrNone(sql, [tx.id])
|
||||||
.then(row => {
|
.then(row => {
|
||||||
return t.any(sql2, [tx.id])
|
return t.any(sql2, [tx.id])
|
||||||
|
|
@ -114,7 +113,6 @@ function insertNewBills (billRows, tx) {
|
||||||
|
|
||||||
const dbBills = _.map(massage, bills)
|
const dbBills = _.map(massage, bills)
|
||||||
const columns = _.keys(dbBills[0])
|
const columns = _.keys(dbBills[0])
|
||||||
console.log('DEBUG333: %j', dbBills)
|
|
||||||
const sql = pgp.helpers.insert(dbBills, columns, 'bills')
|
const sql = pgp.helpers.insert(dbBills, columns, 'bills')
|
||||||
|
|
||||||
return db.none(sql)
|
return db.none(sql)
|
||||||
|
|
@ -136,8 +134,6 @@ function upsert (row, tx) {
|
||||||
function insert (tx) {
|
function insert (tx) {
|
||||||
const dbTx = massage(tx)
|
const dbTx = massage(tx)
|
||||||
|
|
||||||
console.log('DEBUG334: %j', dbTx)
|
|
||||||
|
|
||||||
const sql = pgp.helpers.insert(dbTx, null, 'cash_in_txs') + ' returning *'
|
const sql = pgp.helpers.insert(dbTx, null, 'cash_in_txs') + ' returning *'
|
||||||
return db.one(sql)
|
return db.one(sql)
|
||||||
.then(toObj)
|
.then(toObj)
|
||||||
|
|
@ -156,7 +152,6 @@ function update (tx, changes) {
|
||||||
if (_.isEmpty(changes)) return Promise.resolve(tx)
|
if (_.isEmpty(changes)) return Promise.resolve(tx)
|
||||||
|
|
||||||
const dbChanges = massage(changes)
|
const dbChanges = massage(changes)
|
||||||
console.log('DEBUG893: %j', dbChanges)
|
|
||||||
const sql = pgp.helpers.update(dbChanges, null, 'cash_in_txs') +
|
const sql = pgp.helpers.update(dbChanges, null, 'cash_in_txs') +
|
||||||
pgp.as.format(' where id=$1', [tx.id]) + ' returning *'
|
pgp.as.format(' where id=$1', [tx.id]) + ' returning *'
|
||||||
|
|
||||||
|
|
@ -170,10 +165,7 @@ function postProcess (txVector, pi) {
|
||||||
if (newTx.send && !oldTx.send) {
|
if (newTx.send && !oldTx.send) {
|
||||||
return pi.sendCoins(newTx)
|
return pi.sendCoins(newTx)
|
||||||
.then(txHash => ({txHash}))
|
.then(txHash => ({txHash}))
|
||||||
.catch(error => {
|
.catch(error => ({error}))
|
||||||
console.log('DEBUG895: %j', error)
|
|
||||||
return {error}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.resolve({})
|
return Promise.resolve({})
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ function post (tx, pi) {
|
||||||
function transaction (t) {
|
function transaction (t) {
|
||||||
const sql = 'select * from cash_out_txs where id=$1'
|
const sql = 'select * from cash_out_txs where id=$1'
|
||||||
|
|
||||||
console.log('DEBUG988: %j', tx)
|
|
||||||
return t.oneOrNone(sql, [tx.id])
|
return t.oneOrNone(sql, [tx.id])
|
||||||
.then(toObj)
|
.then(toObj)
|
||||||
.then(oldTx => {
|
.then(oldTx => {
|
||||||
|
|
@ -132,8 +131,6 @@ function insert (tx) {
|
||||||
const dbTx = toDb(tx)
|
const dbTx = toDb(tx)
|
||||||
|
|
||||||
const sql = pgp.helpers.insert(dbTx, null, 'cash_out_txs') + ' returning *'
|
const sql = pgp.helpers.insert(dbTx, null, 'cash_out_txs') + ' returning *'
|
||||||
console.log('DEBUG901: %s', sql)
|
|
||||||
console.log('DEBUG902: %j', dbTx)
|
|
||||||
return db.one(sql)
|
return db.one(sql)
|
||||||
.then(toObj)
|
.then(toObj)
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +139,6 @@ function update (tx, changes) {
|
||||||
if (_.isEmpty(changes)) return Promise.resolve(tx)
|
if (_.isEmpty(changes)) return Promise.resolve(tx)
|
||||||
|
|
||||||
const dbChanges = toDb(tx)
|
const dbChanges = toDb(tx)
|
||||||
console.log('DEBUG893: %j', dbChanges)
|
|
||||||
const sql = pgp.helpers.update(dbChanges, null, 'cash_out_txs') +
|
const sql = pgp.helpers.update(dbChanges, null, 'cash_out_txs') +
|
||||||
pgp.as.format(' where id=$1', [tx.id])
|
pgp.as.format(' where id=$1', [tx.id])
|
||||||
|
|
||||||
|
|
@ -154,7 +150,6 @@ function update (tx, changes) {
|
||||||
|
|
||||||
function preProcess (tx, newTx, pi) {
|
function preProcess (tx, newTx, pi) {
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
console.log('DEBUG910')
|
|
||||||
return pi.newAddress(newTx)
|
return pi.newAddress(newTx)
|
||||||
.then(_.set('toAddress', _, newTx))
|
.then(_.set('toAddress', _, newTx))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,8 +220,6 @@ function plugins (settings, deviceId) {
|
||||||
|
|
||||||
function fiatBalance (fiatCode, cryptoCode) {
|
function fiatBalance (fiatCode, cryptoCode) {
|
||||||
const config = configManager.scoped(cryptoCode, deviceId, settings.config)
|
const config = configManager.scoped(cryptoCode, deviceId, settings.config)
|
||||||
console.log('DEBUG222: %j', config)
|
|
||||||
console.log('DEBUG223: %j', [cryptoCode, deviceId])
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
ticker.getRates(settings, fiatCode, cryptoCode),
|
ticker.getRates(settings, fiatCode, cryptoCode),
|
||||||
wallet.balance(settings, cryptoCode)
|
wallet.balance(settings, cryptoCode)
|
||||||
|
|
|
||||||
|
|
@ -80,14 +80,12 @@ function poll (req, res, next) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTx (req, res, next) {
|
function getTx (req, res, next) {
|
||||||
console.log('DEBUG333: %s', req.query.status)
|
|
||||||
if (req.query.status) {
|
if (req.query.status) {
|
||||||
return helpers.fetchStatusTx(req.params.id, req.query.status)
|
return helpers.fetchStatusTx(req.params.id, req.query.status)
|
||||||
.then(r => res.json(r))
|
.then(r => res.json(r))
|
||||||
.catch(next)
|
.catch(next)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('DEBUG334')
|
|
||||||
return next(httpError('Not Found', 404))
|
return next(httpError('Not Found', 404))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue