Browse Source

integration: use ScriptPubKey for Address

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
4c6385e0d2
  1. 7
      test/integration/p2sh.js

7
test/integration/p2sh.js

@ -24,15 +24,16 @@ describe('Bitcoin-js', function() {
return ECKey.fromWIF(wif)
})
// how much to withdraw if we run dry
var coldAmount = 2e4
var outputAmount = 1e4
var pubKeys = privKeys.map(function(eck) { return eck.pub })
var redeemScript = Script.createMultisigScriptPubKey(2, pubKeys)
var multisigAddress = new Address(redeemScript.getHash(), networks.testnet.scriptHash).toString()
var scriptPubKey = Script.createP2SHScriptPubKey(redeemScript.getHash())
// Send some testnet coins to the multisig address to ensure it has some unspents for later
var multisigAddress = Address.fromScriptPubKey(scriptPubKey, networks.testnet).toString()
// Attempt to send funds to the source address, providing some unspents for later
helloblock.faucet.withdraw(multisigAddress, coldAmount, function(err) {
if (err) return done(err)
})

Loading…
Cancel
Save