diff --git a/build/tasks/doc.js b/build/tasks/doc.js index 730e53c45b..32ed76f7c0 100644 --- a/build/tasks/doc.js +++ b/build/tasks/doc.js @@ -16,12 +16,12 @@ var gulp = require('gulp'); var jsdoc = require('gulp-jsdoc3'); - + gulp.task('doc', function () { gulp.src([ - 'README.md', + 'README.md', 'index.js', - './lib/api.js', + './lib/api.js', './lib/impl/FileKeyValueStore.js', './lib/impl/CryptoSuite_ECDSA_SHA.js', './lib/impl/MemberServices.js', diff --git a/build/tasks/eslint.js b/build/tasks/eslint.js index 997d794df8..5b0fb727fc 100644 --- a/build/tasks/eslint.js +++ b/build/tasks/eslint.js @@ -14,7 +14,8 @@ gulp.task('lint', function () { indent: ['error', 'tab'], 'linebreak-style': ['error', 'unix'], quotes: ['error', 'single'], - semi: ['error', 'always'] + semi: ['error', 'always'], + 'no-trailing-spaces': ['error'] } } )) diff --git a/lib/Member.js b/lib/Member.js index 9ab2802a3a..0db20cb7df 100644 --- a/lib/Member.js +++ b/lib/Member.js @@ -361,7 +361,7 @@ var Member = class { sendDeploymentProposal(request) { // Verify that chaincodePath is being passed if (!request.chaincodePath || request.chaincodePath === '') { - return Promise.reject(new Error('missing chaincodePath in Deployment proposal request')); + return Promise.reject(new Error('missing chaincodePath in Deployment proposal request')); } return new Promise( diff --git a/lib/Orderer.js b/lib/Orderer.js index b401131dba..e453d8711f 100644 --- a/lib/Orderer.js +++ b/lib/Orderer.js @@ -127,7 +127,7 @@ var Orderer = class { broadcast.on('end', function (response) { if(isDebug) debug('Orderer.sendBroadcast - on end:'); - // Removing the promise reject here as on an 'error', this case + // Removing the promise reject here as on an 'error', this case // will hit before the 'error' event, and we loose the error // information coming back to the caller // return reject(response); diff --git a/lib/Peer.js b/lib/Peer.js index 4c9e230fcc..f3d739b96a 100644 --- a/lib/Peer.js +++ b/lib/Peer.js @@ -23,7 +23,7 @@ var grpc = require('grpc'); var _fabricProto = grpc.load(__dirname + '/protos/fabric_next.proto').protos; /** - * The Peer class represents a peer in the target blockchain network to which + * The Peer class represents a peer in the target blockchain network to which * HFC sends endorsement proposals, transaction ordering or query requests. * * @class diff --git a/lib/api.js b/lib/api.js index 9055475ac2..52080f15d1 100644 --- a/lib/api.js +++ b/lib/api.js @@ -59,7 +59,7 @@ module.exports.KeyValueStore = class { /** * Abstract class for a suite of crypto algorithms used by the SDK to perform encryption, * decryption and secure hashing. A complete suite includes libraries for asymmetric - * keys (such as ECDSA or RSA), symmetric keys (such as AES) and secure hash (such as + * keys (such as ECDSA or RSA), symmetric keys (such as AES) and secure hash (such as * SHA2/3). * * The SDK provides a default implementation based on ECDSA + AES + SHA2/3. An alternative @@ -192,10 +192,10 @@ module.exports.CryptoSuite = class { /** * Represents enrollment data for a user. * - * @class + * @class */ module.exports.Enrollment = class { - + constructor() { /** * @member {Buffer} key private key generated locally by the SDK @@ -269,11 +269,11 @@ module.exports.MemberServices = class { * affiliation: {string} what organization this user belongs to, * * registrar: {Object} registrar enables this identity to register other members and can delegate the 'delegationRoles' roles - * + * * roles: {string[]} The allowable roles which this member can register * * delegateRoles: {string[]} The allowable roles which can be registered by members registered by this member - * + * * @param {Member} registrar The identity of the registar (i.e. who is performing the registration) * @returns Promise for the enrollment secret */ @@ -298,7 +298,7 @@ module.exports.MemberServices = class { * @param {Object} req A request object with the following fields: * * name: {string} name of the user - * enrollment: [Enrollment]{@link module:api.Enrollment} an object representing the user to get the TCerts for, + * enrollment: [Enrollment]{@link module:api.Enrollment} an object representing the user to get the TCerts for, * num: {number} batch size, * attrs: {string[]} the list of user attributes to include in the TCerts * @@ -332,21 +332,21 @@ module.exports.PrivacyLevel = { */ module.exports.Certificate = class { - constructor(cert, privateKey, privLevel) { - /** + constructor(cert, privateKey, privacyLevel) { + /** * @member {buffer} cert The certificate * @memberof module:api.Certificate */ this._cert = cert; - /** + /** * @member {buffer} privateKey The private key * @memberof module:api.Certificate */ this._privateKey = privateKey; - /** - * @member {module:api.PrivacyLevel} privacyLevel - Denoting if the Certificate is anonymous or carrying its owner's identity. + /** + * @member {module:api.PrivacyLevel} privacyLevel - Denoting if the Certificate is anonymous or carrying its owner's identity. * @memberof module:api.Certificate */ this._privacyLevel = privacyLevel; @@ -376,7 +376,7 @@ module.exports.ECert = class extends module.exports.Certificate { * @class */ module.exports.TCert = class extends module.exports.Certificate { - + constructor(publicKey, privateKey) { super(publicKey, privateKey, module.exports.PrivacyLevel.Anonymous); } diff --git a/lib/utils-x509cert.js b/lib/utils-x509cert.js index 5b851a1217..21366e4aea 100644 --- a/lib/utils-x509cert.js +++ b/lib/utils-x509cert.js @@ -21,11 +21,11 @@ var _x509schema = require('pkijs/org/pkijs/x509_schema'); var merge = require('node.extend'); /** - * Abstract Syntax Notation One (ASN.1) is a standard and notation that describes - * rules and structures for representing, encoding, transmitting, and decoding data + * Abstract Syntax Notation One (ASN.1) is a standard and notation that describes + * rules and structures for representing, encoding, transmitting, and decoding data * in telecommunications and computer networking * - * + * */ module.exports = function() { // #region Merging function/object declarations for ASN1js and PKIjs diff --git a/test/unit/ca-tests.js b/test/unit/ca-tests.js index 9abf0d4c4f..7c2607b981 100644 --- a/test/unit/ca-tests.js +++ b/test/unit/ca-tests.js @@ -113,7 +113,7 @@ test('registrar test', function(t) { } t.pass('Successfully tested failed registration of validators'); - + chain.setRegistrar(webUser); return registerAndEnroll('webUser2', 'client', null, chain);