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

Commit d86f0bb

Browse files
committed
fix: update to latest cids and uint8array compatible deps
BREAKING CHANGES: - `util.cid` returns `CID`s with a breaking API change - see multiformats/js-cid#117 for changes
1 parent ab4bd6b commit d86f0bb

File tree

5 files changed

+10
-24
lines changed

5 files changed

+10
-24
lines changed

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,14 @@
3434
"homepage": "https://github.com/ipld/js-ipld-zcash#readme",
3535
"dependencies": {
3636
"buffer": "^5.6.0",
37-
"cids": "^0.8.3",
38-
"multicodec": "^1.0.0",
39-
"multihashes": "^1.0.1",
40-
"multihashing-async": "^1.0.0",
37+
"cids": "^1.0.0",
38+
"multicodec": "^2.0.0",
39+
"multihashes": "^3.0.1",
40+
"multihashing-async": "^2.0.0",
4141
"zcash-block": "^2.0.0"
4242
},
4343
"devDependencies": {
44-
"aegir": "^25.0.0",
45-
"chai": "^4.2.0",
46-
"chai-as-promised": "^7.1.1",
47-
"dirty-chai": "^2.0.1"
44+
"aegir": "^25.0.0"
4845
},
4946
"contributors": [
5047
"David Dias <daviddias.p@gmail.com>",

src/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ const serialize = (dagNode) => {
2323
/**
2424
* Deserialize Zcash block into the internal representation.
2525
*
26-
* @param {Buffer} binaryBlob - Binary representation of a Zcash block
26+
* @param {Uint8Array} binaryBlob - Binary representation of a Zcash block
2727
* @returns {ZcashBlock}
2828
*/
2929
const deserialize = (binaryBlob) => {
3030
let deserialized
3131

3232
if (!Buffer.isBuffer(binaryBlob)) {
3333
// zcash only takes Buffers, not Uint8Arrays
34-
binaryBlob = Buffer.from(binaryBlob)
34+
binaryBlob = Buffer.from(binaryBlob, binaryBlob.byteOffset, binaryBlob.byteLength)
3535
}
3636

3737
if (binaryBlob.length < ZCASH_BLOCK_HEADER_SIZE) {

test/mod.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const chai = require('chai')
5-
const dirtyChai = require('dirty-chai')
6-
const expect = chai.expect
7-
chai.use(dirtyChai)
4+
const { expect } = require('aegir/utils/chai')
85
const multicodec = require('multicodec')
96

107
const mod = require('../src')

test/resolver.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const chai = require('chai')
5-
const dirtyChai = require('dirty-chai')
6-
const expect = chai.expect
7-
chai.use(dirtyChai)
4+
const { expect } = require('aegir/utils/chai')
85
const CID = require('cids')
96
const IpldZcash = require('../src/index')
107
const helpers = require('./helpers')

test/util.spec.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const chai = require('chai')
5-
const chaiAsPromised = require('chai-as-promised')
6-
const dirtyChai = require('dirty-chai')
7-
const expect = chai.expect
8-
chai.use(chaiAsPromised)
9-
chai.use(dirtyChai)
4+
const { expect } = require('aegir/utils/chai')
105
const CID = require('cids')
116
const multicodec = require('multicodec')
127
const { Buffer } = require('buffer')

0 commit comments

Comments
 (0)