Skip to content

Commit

Permalink
[FAB-3943] Remove TCert methods from API
Browse files Browse the repository at this point in the history
- getTCertBatchSize()
- setTCertBatchSize()
- isPreFetchMode()
- setPreFetchMode()

both should be removed since TCert support is not enabled yet

Change-Id: If6fee7dcbe948987152ad3acd528a324110a29fe
Signed-off-by: Jim Zhang <jzhang@us.ibm.com>
  • Loading branch information
jimthematrix committed May 16, 2017
1 parent f13f4b4 commit c8706f9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 83 deletions.
1 change: 0 additions & 1 deletion fabric-client/config/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"request-timeout" : 45000,
"tcert-batch-size" : 10,
"crypto-hash-algo": "SHA2",
"crypto-keysize": 256,
"crypto-hsm": false,
Expand Down
44 changes: 0 additions & 44 deletions fabric-client/lib/Chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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);
}

Expand Down Expand Up @@ -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
Expand Down
21 changes: 0 additions & 21 deletions fabric-client/lib/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 0 additions & 17 deletions test/unit/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit c8706f9

Please sign in to comment.