tests/integration: re-broadcast input tx to avoid missing inputs error

This commit is contained in:
Daniel Cousens 2016-01-06 12:46:02 +11:00
parent 382409c575
commit 755c344e16
3 changed files with 26 additions and 37 deletions
test/integration

View file

@ -28,11 +28,9 @@ describe('bitcoinjs-lib (advanced)', function () {
var keyPair = bitcoin.ECPair.makeRandom({ network: network })
var address = keyPair.getAddress()
blockchain.t.faucet(address, 2e4, function (err, unspents) {
blockchain.t.faucet(address, 2e4, function (err, unspent) {
if (err) return done(err)
// use the oldest unspent
var unspent = unspents.pop()
var tx = new bitcoin.TransactionBuilder(network)
var data = new Buffer('bitcoinjs-lib')
var dataScript = bitcoin.script.nullDataOutput(data)
@ -76,12 +74,9 @@ describe('bitcoinjs-lib (advanced)', function () {
beforeEach(function (done) {
this.timeout(10000)
blockchain.t.faucet(alice.getAddress(), 2e4, function (err, unspents) {
blockchain.t.faucet(alice.getAddress(), 2e4, function (err, unspent) {
if (err) return done(err)
// use the oldest unspent
var unspent = unspents.pop()
// build the transaction
var tx = new bitcoin.TransactionBuilder(network)
tx.addInput(unspent.txId, unspent.vout)