TxBuilder: limit signatures depending on scriptType
This commit is contained in:
parent
e5618bb8bd
commit
8d5ef2dd06
2 changed files with 11 additions and 0 deletions
|
@ -110,6 +110,15 @@ describe('TransactionBuilder', function() {
|
|||
})
|
||||
})
|
||||
|
||||
it('throws if scriptType doesn\'t support multiple signatures', function() {
|
||||
txb.addInput(prevTxHash, 0)
|
||||
txb.sign(0, privKey)
|
||||
|
||||
assert.throws(function() {
|
||||
txb.sign(0, privKey)
|
||||
}, /pubkeyhash doesn\'t support multiple signatures/)
|
||||
})
|
||||
|
||||
describe('when redeemScript is undefined', function() {
|
||||
it('throws if prevOutScript is P2SH', function() {
|
||||
var privScriptP2SH = scripts.scriptHashOutput(privScript.getHash())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue