tests/integration: throw verbose error if unspent is missing

This commit is contained in:
Daniel Cousens 2018-07-20 17:35:34 +10:00
parent de0259a820
commit 31ab9bfc03

View file

@ -38,7 +38,10 @@ function faucet (address, value, callback) {
unspents(address, function (err, results) {
if (err) return callback(err)
callback(null, results.filter(x => x.txId === txId).pop())
const unspents = results.filter(x => x.txId === txId)
if (unspents.length === 0) return callback(new Error('Missing unspent'))
callback(null, unspents.pop())
})
})
}