Transaction: mass rename from SPK/SS to Input/Output

I think it is important we maintain some reasoning that an Input script
is actually a script signature, but in the end, these names are more
coherent and understandable when reasoning with our code.  So I think
its OK we break tradition with bitcoind.
This commit is contained in:
Daniel Cousens 2014-06-13 11:30:07 +10:00
parent 5a96df1ec1
commit 7e5af52cd1
8 changed files with 39 additions and 41 deletions
test/integration

View file

@ -32,7 +32,7 @@ describe('Bitcoin-js', function() {
var redeemScript = scripts.multisigOutput(2, pubKeys)
var scriptPubKey = scripts.scriptHashOutput(redeemScript.getHash())
var multisigAddress = Address.fromScriptPubKey(scriptPubKey, networks.testnet).toString()
var multisigAddress = Address.fromOutputScript(scriptPubKey, networks.testnet).toString()
// Attempt to send funds to the source address, providing some unspents for later
helloblock.faucet.withdraw(multisigAddress, coldAmount, function(err) {
@ -55,12 +55,12 @@ describe('Bitcoin-js', function() {
tx.addOutput(targetAddress, spendAmount)
var signatures = privKeys.map(function(privKey) {
return tx.signScriptSig(0, redeemScript, privKey)
return tx.signInput(0, redeemScript, privKey)
})
var redeemScriptSig = scripts.multisigInput(signatures)
var scriptSig = scripts.scriptHashInput(redeemScriptSig, redeemScript)
tx.setScriptSig(0, scriptSig)
tx.setInputScript(0, scriptSig)
// broadcast our transaction
helloblock.transactions.propagate(tx.toHex(), function(err, resp, resource) {