From 6457e9af1add3f6ae404b48480cb3a3ae9675e8f Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 7 Sep 2017 10:44:46 +0200 Subject: [PATCH] feat: replace protocol-buffers with protons Ref https://github.com/ipfs/js-ipfs/issues/991 --- package.json | 2 +- src/types/message/index.js | 4 ++-- test/types/message.spec.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 31327109..865997d8 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "lodash.uniqwith": "^4.5.0", "lodash.values": "^4.3.0", "multihashing-async": "~0.4.6", - "protocol-buffers": "^3.2.1", + "protons": "^1.0.0", "pull-defer": "^0.2.2", "pull-length-prefixed": "^1.3.0", "pull-pushable": "^2.1.1", diff --git a/src/types/message/index.js b/src/types/message/index.js index 88e118ff..53a7dfa6 100644 --- a/src/types/message/index.js +++ b/src/types/message/index.js @@ -1,6 +1,6 @@ 'use strict' -const protobuf = require('protocol-buffers') +const protons = require('protons') const Block = require('ipfs-block') const isEqualWith = require('lodash.isequalwith') const assert = require('assert') @@ -10,7 +10,7 @@ const codecName = require('multicodec/src/name-table') const vd = require('varint-decoder') const multihashing = require('multihashing-async') -const pbm = protobuf(require('./message.proto')) +const pbm = protons(require('./message.proto')) const Entry = require('./entry') class BitswapMessage { diff --git a/test/types/message.spec.js b/test/types/message.spec.js index f3b10890..9e155f70 100644 --- a/test/types/message.spec.js +++ b/test/types/message.spec.js @@ -5,7 +5,7 @@ const chai = require('chai') chai.use(require('dirty-chai')) const expect = chai.expect -const protobuf = require('protocol-buffers') +const protons = require('protons') const map = require('async/map') const CID = require('cids') const isNode = require('detect-node') @@ -16,7 +16,7 @@ const testDataPath = (isNode ? '../' : '') + 'fixtures/serialized-from-go' const rawMessageFullWantlist = loadFixture(__dirname, testDataPath + '/bitswap110-message-full-wantlist') const rawMessageOneBlock = loadFixture(__dirname, testDataPath + '/bitswap110-message-one-block') -const pbm = protobuf(require('../../src/types/message/message.proto')) +const pbm = protons(require('../../src/types/message/message.proto')) const BitswapMessage = require('../../src/types/message') const makeBlock = require('../utils/make-block')