tests: merge witness fixtures with valid transactions, reverse reversed hashs (failing)
This commit is contained in:
parent
a1755a43c0
commit
0c198ffa6a
2 changed files with 508 additions and 534 deletions
1019
test/fixtures/transaction.json
vendored
1019
test/fixtures/transaction.json
vendored
File diff suppressed because it is too large
Load diff
|
@ -54,23 +54,22 @@ describe('Transaction', function () {
|
||||||
var id = f.id || f.hash
|
var id = f.id || f.hash
|
||||||
var txHex = f.hex || f.txHex
|
var txHex = f.hex || f.txHex
|
||||||
|
|
||||||
if (f.hasWitness) {
|
|
||||||
it('imports ' + f.description + ' (' + id + ') as witness', function () {
|
|
||||||
var actual = Transaction.fromHex(f.witnessHex)
|
|
||||||
|
|
||||||
assert.strictEqual(actual.toHex(), f.witnessHex, actual.toHex())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
it('imports ' + f.description + ' (' + id + ')', function () {
|
it('imports ' + f.description + ' (' + id + ')', function () {
|
||||||
var actual = Transaction.fromHex(txHex)
|
var actual = Transaction.fromHex(txHex)
|
||||||
|
|
||||||
assert.strictEqual(actual.toHex(), txHex, actual.toHex())
|
assert.strictEqual(actual.toHex(), txHex)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (f.whex) {
|
||||||
|
it('imports ' + f.description + ' (' + id + ') as witness', function () {
|
||||||
|
var actual = Transaction.fromHex(f.whex)
|
||||||
|
|
||||||
|
assert.strictEqual(actual.toHex(), f.whex)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtures.valid.forEach(importExport)
|
fixtures.valid.forEach(importExport)
|
||||||
fixtures.witness.forEach(importExport)
|
|
||||||
fixtures.hashForSignature.forEach(importExport)
|
fixtures.hashForSignature.forEach(importExport)
|
||||||
fixtures.hashForWitnessV0.forEach(importExport)
|
fixtures.hashForWitnessV0.forEach(importExport)
|
||||||
|
|
||||||
|
@ -95,7 +94,7 @@ describe('Transaction', function () {
|
||||||
it('exports ' + f.description + ' (' + f.id + ')', function () {
|
it('exports ' + f.description + ' (' + f.id + ')', function () {
|
||||||
var actual = fromRaw(f.raw)
|
var actual = fromRaw(f.raw)
|
||||||
|
|
||||||
assert.strictEqual(actual.toHex(), f.hex, actual.toHex())
|
assert.strictEqual(actual.toHex(), f.whex || f.hex, actual.toHex())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -189,7 +188,6 @@ describe('Transaction', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtures.valid.forEach(verify)
|
fixtures.valid.forEach(verify)
|
||||||
fixtures.witness.forEach(verify)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('isCoinbase', function () {
|
describe('isCoinbase', function () {
|
||||||
|
@ -202,7 +200,6 @@ describe('Transaction', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
fixtures.valid.forEach(verify)
|
fixtures.valid.forEach(verify)
|
||||||
fixtures.witness.forEach(verify)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('hashForSignature', function () {
|
describe('hashForSignature', function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue