tests/integration: throw verbose error if unspent is missing
This commit is contained in:
parent
de0259a820
commit
31ab9bfc03
1 changed files with 4 additions and 1 deletions
|
@ -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())
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue