Browse Source

TxBuilder: remove unnecessary assert

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
1e3e003120
  1. 2
      src/transaction_builder.js
  2. 6
      test/transaction_builder.js

2
src/transaction_builder.js

@ -24,8 +24,6 @@ TransactionBuilder.prototype.addInput = function(prevTx, index, prevOutScript) {
Array.prototype.reverse.call(prevOutHash)
} else if (prevTx instanceof Transaction) {
assert(prevOutScript === undefined, 'Unnecessary Script provided')
prevOutHash = prevTx.getHash()
prevOutScript = prevTx.outs[index].script

6
test/transaction_builder.js

@ -68,12 +68,6 @@ describe('TransactionBuilder', function() {
assert.equal(txb.addInput(prevTxHash, 1), 1)
})
it('throws if a Tx and prevOutScript is given', function() {
assert.throws(function() {
txb.addInput(prevTx, 0, privScript)
}, /Unnecessary Script provided/)
})
it('throws if prevOutScript is not supported', function() {
assert.throws(function() {
txb.addInput(prevTxHash, 0, Script.EMPTY)

Loading…
Cancel
Save