tests: move export as witness to independent test
This commit is contained in:
parent
3feb9f1acc
commit
46c87afa3f
1 changed files with 8 additions and 6 deletions
|
@ -90,14 +90,16 @@ describe('Transaction', function () {
|
||||||
describe('toBuffer/toHex', function () {
|
describe('toBuffer/toHex', function () {
|
||||||
fixtures.valid.forEach(function (f) {
|
fixtures.valid.forEach(function (f) {
|
||||||
it('exports ' + f.description + ' (' + f.id + ')', function () {
|
it('exports ' + f.description + ' (' + f.id + ')', function () {
|
||||||
if (f.whex) {
|
|
||||||
var wactual = fromRaw(f.raw)
|
|
||||||
assert.strictEqual(wactual.toHex(), f.whex)
|
|
||||||
}
|
|
||||||
|
|
||||||
var actual = fromRaw(f.raw, true)
|
var actual = fromRaw(f.raw, true)
|
||||||
assert.strictEqual(actual.toHex(), f.hex)
|
assert.strictEqual(actual.toHex(), f.hex)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (f.whex) {
|
||||||
|
it('exports ' + f.description + ' (' + f.id + ') as witness', function () {
|
||||||
|
var wactual = fromRaw(f.raw)
|
||||||
|
assert.strictEqual(wactual.toHex(), f.whex)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('accepts target Buffer and offset parameters', function () {
|
it('accepts target Buffer and offset parameters', function () {
|
||||||
|
@ -189,7 +191,7 @@ describe('Transaction', function () {
|
||||||
|
|
||||||
describe('getHash/getId', function () {
|
describe('getHash/getId', function () {
|
||||||
function verify (f) {
|
function verify (f) {
|
||||||
it('should return the id for ' + f.id, function () {
|
it('should return the id for ' + f.id + '(' + f.description + ')', function () {
|
||||||
var tx = Transaction.fromHex(f.whex || f.hex)
|
var tx = Transaction.fromHex(f.whex || f.hex)
|
||||||
|
|
||||||
assert.strictEqual(tx.getHash().toString('hex'), f.hash)
|
assert.strictEqual(tx.getHash().toString('hex'), f.hash)
|
||||||
|
|
Loading…
Add table
Reference in a new issue