integration: use ScriptPubKey for Address

This commit is contained in:
Daniel Cousens 2014-06-05 00:06:28 +10:00
parent 2b563ec55a
commit 4c6385e0d2

View file

@ -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)
})