Skip to content

Commit

Permalink
[FABN-1435] Remove stream-buffers from lifecycle code (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Stone <[email protected]>
  • Loading branch information
Simon Stone authored and andrew-coleman committed Dec 13, 2019
1 parent d06fcdf commit 55b5398
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 83 deletions.
9 changes: 4 additions & 5 deletions fabric-client/lib/packager/Lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

'use strict';

const sbuf = require('stream-buffers');
const {Utils: utils} = require('fabric-common');

const logger = utils.getLogger('packager/Lifecycle.js');

const BasePackager = require('./BasePackager');
const BufferStream = require('./BufferStream');

class LifecyclePackager extends BasePackager {
/**
Expand All @@ -41,13 +41,12 @@ class LifecyclePackager extends BasePackager {
// strictly necessary yet, they pave the way for the future where we
// will need to assemble sources from multiple packages

const buffer = new sbuf.WritableStreamBuffer();

let descriptors = this.buildMetaDataDescriptors(label, chaincodeType, chaincodePath);
const package_descriptors = this.buildPackageDescriptors(packageBytes);
descriptors = descriptors.concat(package_descriptors);
await super.generateTarGz(descriptors, buffer);
const return_bytes = buffer.getContents();
const stream = new BufferStream();
await super.generateTarGz(descriptors, stream);
const return_bytes = stream.toBuffer();
logger.debug('%s - packaged bytes %s', method, return_bytes.length);

return return_bytes;
Expand Down
33 changes: 3 additions & 30 deletions fabric-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 3 additions & 39 deletions fabric-network/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fabric-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"tag": "unstable",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/fabric-sdk-node"
"type": "git",
"url": "https://github.com/hyperledger/fabric-sdk-node"
},
"homepage": "https://www.hyperledger.org/projects/fabric",
"author": {
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"run-sequence": "^2.2.1",
"sinon": "6.1.3",
"sinon-chai": "^3.3.0",
"stream-buffers": "3.0.1",
"strip-ansi": "5.2.0",
"tap-colorize": "^1.2.0",
"tape": "^4.5.1",
Expand Down

0 comments on commit 55b5398

Please sign in to comment.