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

Commit

Permalink
fix: update to latest cids and uint8array compatible deps
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

- `util.cid` returns `CID`s with a breaking API change - see multiformats/js-cid#117 for changes
  • Loading branch information
achingbrain authored and vmx committed Aug 4, 2020
1 parent ab4bd6b commit c613e57
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@
"homepage": "https://github.com/ipld/js-ipld-zcash#readme",
"dependencies": {
"buffer": "^5.6.0",
"cids": "^0.8.3",
"multicodec": "^1.0.0",
"multihashes": "^1.0.1",
"multihashing-async": "^1.0.0",
"cids": "^1.0.0",
"multicodec": "^2.0.0",
"multihashes": "^3.0.1",
"multihashing-async": "^2.0.0",
"zcash-block": "^2.0.0"
},
"devDependencies": {
"aegir": "^25.0.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"dirty-chai": "^2.0.1"
"aegir": "^25.0.0"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
Expand Down
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ const serialize = (dagNode) => {
/**
* Deserialize Zcash block into the internal representation.
*
* @param {Buffer} binaryBlob - Binary representation of a Zcash block
* @param {Uint8Array} binaryBlob - Binary representation of a Zcash block
* @returns {ZcashBlock}
*/
const deserialize = (binaryBlob) => {
let deserialized

if (!Buffer.isBuffer(binaryBlob)) {
// zcash only takes Buffers, not Uint8Arrays
binaryBlob = Buffer.from(binaryBlob)
binaryBlob = Buffer.from(binaryBlob, binaryBlob.byteOffset, binaryBlob.byteLength)
}

if (binaryBlob.length < ZCASH_BLOCK_HEADER_SIZE) {
Expand Down
5 changes: 1 addition & 4 deletions test/mod.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('aegir/utils/chai')
const multicodec = require('multicodec')

const mod = require('../src')
Expand Down
5 changes: 1 addition & 4 deletions test/resolver.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('aegir/utils/chai')
const CID = require('cids')
const IpldZcash = require('../src/index')
const helpers = require('./helpers')
Expand Down
7 changes: 1 addition & 6 deletions test/util.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const chaiAsPromised = require('chai-as-promised')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(chaiAsPromised)
chai.use(dirtyChai)
const { expect } = require('aegir/utils/chai')
const CID = require('cids')
const multicodec = require('multicodec')
const { Buffer } = require('buffer')
Expand Down

0 comments on commit c613e57

Please sign in to comment.