integration: return funds to our faucet
This commit is contained in:
parent
809e23f550
commit
52bcfe72be
5 changed files with 9 additions and 6 deletions
|
@ -59,6 +59,8 @@ testnet.faucet = function faucet (address, value, callback) {
|
|||
})
|
||||
}
|
||||
|
||||
testnet.RETURN = kpAddress
|
||||
|
||||
module.exports = {
|
||||
m: mainnet,
|
||||
t: testnet
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue