Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 05b6424

Browse files
committed
fix: tests of Zcash were broken
The Zcash tests were broken due to a change in the underlying js-ipld-zcash library.
1 parent fdb957e commit 05b6424

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

test/ipld-zcash.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const expect = chai.expect
77
chai.use(dirtyChai)
88
const BlockService = require('ipfs-block-service')
99
const ipldZcash = require('ipld-zcash')
10-
const ZcashBlock = require('zcash-bitcore-lib').Block
10+
const ZcashBlockHeader = require('zcash-bitcore-lib').BlockHeader
1111
const multihash = require('multihashes')
1212
const series = require('async/series')
1313
const each = require('async/each')
@@ -23,12 +23,10 @@ const buildZcashBlock = (header) => {
2323
header.time = header.time || 0
2424
header.bits = header.bits || 0
2525
header.nonce = header.nonce || Buffer.alloc(32)
26-
header.solution = header.solution || Buffer.alloc(0)
27-
const block = ZcashBlock.fromObject({
28-
header: header,
29-
transactions: []
30-
})
31-
return block
26+
header.solution = header.solution || Buffer.alloc(1344)
27+
28+
const blockHeader = ZcashBlockHeader(header)
29+
return blockHeader
3230
}
3331

3432
module.exports = (repo) => {
@@ -114,7 +112,7 @@ module.exports = (repo) => {
114112
expect(err).to.not.exist()
115113
resolver.get(cid1, (err, result) => {
116114
expect(err).to.not.exist()
117-
expect(node1.header.version).to.eql(result.value.header.version)
115+
expect(node1.version).to.eql(result.value.version)
118116
done()
119117
})
120118
})
@@ -193,7 +191,7 @@ module.exports = (repo) => {
193191
expect(err).to.not.exist()
194192
resolver.get(cid1, (err, result) => {
195193
expect(err).to.not.exist()
196-
expect(result.value.header.version).to.eql(1)
194+
expect(result.value.version).to.eql(1)
197195
remove()
198196
})
199197
})

0 commit comments

Comments
 (0)