tests: add tests for Transaction.hashForSignature
This commit is contained in:
parent
07628ff034
commit
4898cc7b67
2 changed files with 49 additions and 2 deletions
test
|
@ -172,6 +172,14 @@ describe('Transaction', function () {
|
|||
})
|
||||
})
|
||||
|
||||
// TODO:
|
||||
// hashForSignature: [Function],
|
||||
describe('hashForSignature', function () {
|
||||
fixtures.hashForSignature.forEach(function (f) {
|
||||
it('should return ' + f.hash + ' for ' + (f.description ? ('case "' + f.description + '"') : f.script), function () {
|
||||
var tx = Transaction.fromHex(f.txHex)
|
||||
var script = bscript.fromASM(f.script)
|
||||
|
||||
assert.strictEqual(tx.hashForSignature(f.inIndex, script, f.type).toString('hex'), f.hash)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue