diff --git a/test/integration/_blockchain.js b/test/integration/_blockchain.js index 9460709..e414b03 100644 --- a/test/integration/_blockchain.js +++ b/test/integration/_blockchain.js @@ -59,6 +59,8 @@ testnet.faucet = function faucet (address, value, callback) { }) } +testnet.RETURN = kpAddress + module.exports = { m: mainnet, t: testnet diff --git a/test/integration/advanced.js b/test/integration/advanced.js index 49d3361..472e483 100644 --- a/test/integration/advanced.js +++ b/test/integration/advanced.js @@ -20,6 +20,7 @@ describe('bitcoinjs-lib (advanced)', function () { tx.addInput(unspent.txId, unspent.vout) tx.addOutput(dataScript, 1000) + tx.addOutput(blockchain.t.RETURN, 1e4) tx.sign(0, keyPair) var txRaw = tx.build() diff --git a/test/integration/basic.js b/test/integration/basic.js index 5e48757..93d314b 100644 --- a/test/integration/basic.js +++ b/test/integration/basic.js @@ -83,7 +83,7 @@ describe('bitcoinjs-lib (basic)', function () { var tx = new bitcoin.TransactionBuilder(network) tx.addInput(unspents[0].txId, unspents[0].vout) tx.addInput(unspents[1].txId, unspents[1].vout) - tx.addOutput('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', 1e4) + tx.addOutput(blockchain.t.RETURN, 1e4) tx.addOutput('mvGVHWi6gbkBZZPaqBVRcxvKVPYd9r3fp7', 1e4) tx.sign(0, alice) tx.sign(1, bob) diff --git a/test/integration/cltv.js b/test/integration/cltv.js index 8009bb8..21eab66 100644 --- a/test/integration/cltv.js +++ b/test/integration/cltv.js @@ -49,7 +49,7 @@ describe('bitcoinjs-lib (CLTV)', function () { var tx = new bitcoin.TransactionBuilder(network) tx.setLockTime(timeUtc) tx.addInput(unspent.txId, 0, 0xfffffffe) - tx.addOutput('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', 1e4) + tx.addOutput(blockchain.t.RETURN, 1e4) var txRaw = tx.buildIncomplete() var signatureHash = txRaw.hashForSignature(0, redeemScript, hashType) @@ -82,7 +82,7 @@ describe('bitcoinjs-lib (CLTV)', function () { var tx = new bitcoin.TransactionBuilder(network) tx.addInput(unspent.txId, 0, 0xfffffffe) - tx.addOutput('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', 1e4) + tx.addOutput(blockchain.t.RETURN, 1e4) var txRaw = tx.buildIncomplete() var signatureHash = txRaw.hashForSignature(0, redeemScript, hashType) @@ -115,7 +115,7 @@ describe('bitcoinjs-lib (CLTV)', function () { var tx = new bitcoin.TransactionBuilder(network) tx.setLockTime(timeUtc) tx.addInput(unspent.txId, 0, 0xfffffffe) - tx.addOutput('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', 1e4) + tx.addOutput(blockchain.t.RETURN, 1e4) var txRaw = tx.buildIncomplete() var signatureHash = txRaw.hashForSignature(0, redeemScript, hashType) diff --git a/test/integration/multisig.js b/test/integration/multisig.js index 5f27e4e..fbb4bd8 100644 --- a/test/integration/multisig.js +++ b/test/integration/multisig.js @@ -43,7 +43,7 @@ describe('bitcoinjs-lib (multisig)', function () { var txb = new bitcoin.TransactionBuilder(bitcoin.networks.testnet) txb.addInput(unspent.txId, unspent.vout) - txb.addOutput('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', 1e4) + txb.addOutput(blockchain.t.RETURN, 1e4) // sign with 1st and 3rd key txb.sign(0, keyPairs[0], redeemScript) @@ -60,7 +60,7 @@ describe('bitcoinjs-lib (multisig)', function () { async.retry(5, function (callback) { setTimeout(function () { // check that the above transaction included the intended address - blockchain.t.addresses.unspents('n2eMqTT929pb1RDNuqEnxdaLau1rxy3efi', function (err, unspents) { + blockchain.t.addresses.unspents(blockchain.t.RETURN, function (err, unspents) { if (err) return callback(err) if (!unspents.some(function (unspent) { return unspent.txId === txId && unspent.value === 1e4