feat: improve debug logs
This commit is contained in:
parent
dc10537044
commit
5633f50c96
2 changed files with 19 additions and 9 deletions
|
|
@ -34,6 +34,14 @@ function rateWallet (account, cryptoCode, address) {
|
|||
headers: authHeader
|
||||
})
|
||||
.then(res => ({ address, score: res.data.risk, isValid: res.data.risk < threshold }))
|
||||
.then(result => {
|
||||
console.log(`** DEBUG ** rateWallet RETURN: ${result}`)
|
||||
return result
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(`** DEBUG ** rateWallet ERROR: ${err.message}`)
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
function isValidWalletScore (account, score) {
|
||||
|
|
@ -60,8 +68,13 @@ function getTransactionHash (account, cryptoCode, receivingAddress) {
|
|||
if (_.size(data.txHistory) > 1) {
|
||||
logger.warn('An address generated by this wallet was used in more than one transaction')
|
||||
}
|
||||
console.log(`** DEBUG ** getTransactionHash RETURN: ${_.join(', ', _.map(it => it.txHash, data.txHistory))}`)
|
||||
return _.join(', ', _.map(it => it.txHash, data.txHistory))
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(`** DEBUG ** getTransactionHash ERROR: ${err}`)
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
function getInputAddresses (account, cryptoCode, txHashes) {
|
||||
|
|
@ -84,8 +97,14 @@ function getInputAddresses (account, cryptoCode, txHashes) {
|
|||
const transactionInputs = _.flatMap(it => it.inputs, data.transactions)
|
||||
const inputAddresses = _.map(it => it.address, transactionInputs)
|
||||
|
||||
console.log(`** DEBUG ** getInputAddresses RETURN: ${inputAddresses}`)
|
||||
|
||||
return inputAddresses
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(`** DEBUG ** getInputAddresses ERROR: ${err.message}`)
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue