txb/tests: add solo SIGHASH_ALL fixes

This commit is contained in:
Daniel Cousens 2018-09-26 14:47:14 +10:00
parent 2223e6170e
commit a58c5b4f5b
3 changed files with 27 additions and 4 deletions

View file

@ -2359,7 +2359,7 @@
]
},
{
"description": "Transaction w/ no outputs (but 1 SIGHASH_ALL)",
"description": "Transaction w/ no outputs (but 1 SIGHASH_NONE)",
"exception": "Transaction needs outputs",
"inputs": [
{
@ -2367,7 +2367,8 @@
"vout": 0,
"signs": [
{
"keyPair": "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn"
"keyPair": "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn",
"hashType": 2
}
]
},
@ -2383,6 +2384,23 @@
}
],
"outputs": []
},
{
"description": "Transaction w/ no outputs",
"exception": "Transaction needs outputs",
"inputs": [
{
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"vout": 0,
"signs": [
{
"keyPair": "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn",
"throws": true
}
]
}
],
"outputs": []
}
],
"fromTransaction": [

View file

@ -231,6 +231,7 @@ describe('TransactionBuilder', function () {
it('throws if SIGHASH_ALL has been used to sign any existing scriptSigs', function () {
txb.addInput(txHash, 0)
txb.addOutput(scripts[0], 1000)
txb.sign(0, keyPair)
assert.throws(function () {