From c8706f95af21a0fa8344b428c224d0e6fd786727 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Mon, 15 May 2017 22:35:13 -0400 Subject: [PATCH] [FAB-3943] Remove TCert methods from API - getTCertBatchSize() - setTCertBatchSize() - isPreFetchMode() - setPreFetchMode() both should be removed since TCert support is not enabled yet Change-Id: If6fee7dcbe948987152ad3acd528a324110a29fe Signed-off-by: Jim Zhang --- fabric-client/config/default.json | 1 - fabric-client/lib/Chain.js | 44 ------------------------------- fabric-client/lib/User.js | 21 --------------- test/unit/chain.js | 17 ------------ 4 files changed, 83 deletions(-) diff --git a/fabric-client/config/default.json b/fabric-client/config/default.json index f0d25bcec4..ce81bcdccc 100644 --- a/fabric-client/config/default.json +++ b/fabric-client/config/default.json @@ -1,6 +1,5 @@ { "request-timeout" : 45000, - "tcert-batch-size" : 10, "crypto-hash-algo": "SHA2", "crypto-keysize": 256, "crypto-hsm": false, diff --git a/fabric-client/lib/Chain.js b/fabric-client/lib/Chain.js index e0a4929323..1b8d5df975 100755 --- a/fabric-client/lib/Chain.js +++ b/fabric-client/lib/Chain.js @@ -93,13 +93,6 @@ var Chain = class { // Security enabled flag this._securityEnabled = true;//to do - // The number of tcerts to get in each batch - this._tcertBatchSize = utils.getConfigSetting('tcert-batch-size',200); - - // If in prefetch mode, we prefetch tcerts from member - // services to help performance - this._preFetchMode = true;//to do - not in doc - this._peers = []; this._primary_peer = null; // if not set, will use the first peer on the list this._anchor_peers = []; @@ -113,11 +106,9 @@ var Chain = class { //to do update logger logger.debug('Constructed Chain instance: name - %s, ' + 'securityEnabled: %s, ' + - 'TCert download batch size: %s, ' + 'network mode: %s', this._name, this._securityEnabled, - this._tcertBatchSize, !this._devMode); } @@ -159,41 +150,6 @@ var Chain = class { return this._name; } - /** - * Determine if security is enabled. - */ - isSecurityEnabled() { - return true;//to do - } - - /** - * Determine if pre-fetch mode is enabled to prefetch tcerts. - */ - isPreFetchMode() { - return this._preFetchMode; - } - - /** - * Set prefetch mode to true or false. - */ - setPreFetchMode(preFetchMode) { - this._preFetchMode = preFetchMode; - } - - /** - * Get the tcert batch size. - */ - getTCertBatchSize() { - return this._tcertBatchSize; - } - - /** - * Set the tcert batch size. - */ - setTCertBatchSize(batchSize) { - this._tcertBatchSize = batchSize; - } - /** * Get organizational unit identifiers from * the MSP's for this channel diff --git a/fabric-client/lib/User.js b/fabric-client/lib/User.js index b4c2108545..04447c2bf9 100644 --- a/fabric-client/lib/User.js +++ b/fabric-client/lib/User.js @@ -187,27 +187,6 @@ var User = class { }); } - /** - * Get the transaction certificate (tcert) batch size, which is the number of tcerts retrieved - * from member services each time (i.e. in a single batch). - * @returns {int} The tcert batch size. - */ - getTCertBatchSize() { - if (this._tcertBatchSize === undefined) { - return this._chain.getTCertBatchSize(); - } else { - return this._tcertBatchSize; - } - } - - /** - * Set the transaction certificate (tcert) batch size. - * @param {int} batchSize - */ - setTCertBatchSize(batchSize) { - this._tcertBatchSize = batchSize; - } - /** * Determine if this name has been enrolled. * @returns {boolean} True if enrolled; otherwise, false. diff --git a/test/unit/chain.js b/test/unit/chain.js index 8e8cebda3e..7ddf464bd5 100644 --- a/test/unit/chain.js +++ b/test/unit/chain.js @@ -74,23 +74,6 @@ test('\n\n ** Chain - constructor test **\n\n', function (t) { }); test('\n\n ** Chain - method tests **\n\n', function (t) { - t.equal(_chain.isSecurityEnabled(), true, 'checking security setting'); - t.doesNotThrow( - function () { - _chain.setPreFetchMode(true); - }, - null, - 'checking the set of prefetchMode' - ); - t.equal(_chain.isPreFetchMode(), true, 'checking prefetchMode'); - t.doesNotThrow( - function () { - _chain.setTCertBatchSize(123); - }, - null, - 'checking the set of TCertBatchSize' - ); - t.equal(_chain.getTCertBatchSize(), 123, 'checking getTCertBatchSize'); t.doesNotThrow( function () { var orderer = new Orderer('grpc://somehost.com:1234');