From bfdc0b6e7a7caab2174c4b05779cf3cbc9b73cb5 Mon Sep 17 00:00:00 2001 From: clydedacruz Date: Wed, 8 Aug 2018 23:32:53 +0530 Subject: [PATCH] FAB-11518 Fixed typo in instatiate-chaincode.js and removed unused imports from other JavaScript files in balance-transfer/app Change-Id: If9695c4f51e9c0835230b2c7f969cbf4aa132675 Signed-off-by: Clyde DCruz --- balance-transfer/app/create-channel.js | 1 - balance-transfer/app/helper.js | 10 ---------- balance-transfer/app/install-chaincode.js | 6 +----- balance-transfer/app/instantiate-chaincode.js | 7 ++----- balance-transfer/app/invoke-transaction.js | 3 --- balance-transfer/app/join-channel.js | 4 +--- balance-transfer/app/query.js | 3 --- 7 files changed, 4 insertions(+), 30 deletions(-) diff --git a/balance-transfer/app/create-channel.js b/balance-transfer/app/create-channel.js index 80e27c19be..754d18a02c 100644 --- a/balance-transfer/app/create-channel.js +++ b/balance-transfer/app/create-channel.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var util = require('util'); var fs = require('fs'); var path = require('path'); diff --git a/balance-transfer/app/helper.js b/balance-transfer/app/helper.js index 42f579f6de..6489619154 100644 --- a/balance-transfer/app/helper.js +++ b/balance-transfer/app/helper.js @@ -20,19 +20,9 @@ logger.setLevel('DEBUG'); var path = require('path'); var util = require('util'); -var copService = require('fabric-ca-client'); var hfc = require('fabric-client'); hfc.setLogger(logger); -var ORGS = hfc.getConfigSetting('network-config'); - -var clients = {}; -var channels = {}; -var caClients = {}; - -var sleep = async function (sleep_time_ms) { - return new Promise(resolve => setTimeout(resolve, sleep_time_ms)); -} async function getClientForOrg (userorg, username) { logger.debug('getClientForOrg - ****** START %s %s', userorg, username) diff --git a/balance-transfer/app/install-chaincode.js b/balance-transfer/app/install-chaincode.js index 5d976f4e0a..938e59f8da 100644 --- a/balance-transfer/app/install-chaincode.js +++ b/balance-transfer/app/install-chaincode.js @@ -14,13 +14,9 @@ * limitations under the License. */ 'use strict'; -var path = require('path'); -var fs = require('fs'); var util = require('util'); -var config = require('../config.json'); var helper = require('./helper.js'); var logger = helper.getLogger('install-chaincode'); -var tx_id = null; var installChaincode = async function(peers, chaincodeName, chaincodePath, chaincodeVersion, chaincodeType, username, org_name) { @@ -76,7 +72,7 @@ var installChaincode = async function(peers, chaincodeName, chaincodePath, } if (!error_message) { - let message = util.format('Successfully install chaincode'); + let message = util.format('Successfully installed chaincode'); logger.info(message); // build a response to send back to the REST caller let response = { diff --git a/balance-transfer/app/instantiate-chaincode.js b/balance-transfer/app/instantiate-chaincode.js index 1c6455a570..aa8e040481 100644 --- a/balance-transfer/app/instantiate-chaincode.js +++ b/balance-transfer/app/instantiate-chaincode.js @@ -14,10 +14,7 @@ * limitations under the License. */ 'use strict'; -var path = require('path'); -var fs = require('fs'); var util = require('util'); -var hfc = require('fabric-client'); var helper = require('./helper.js'); var logger = helper.getLogger('instantiate-chaincode'); @@ -117,7 +114,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha clearTimeout(event_timeout); if (code !== 'VALID') { - let message = until.format('The chaincode instantiate transaction was invalid, code:%s',code); + let message = util.format('The chaincode instantiate transaction was invalid, code:%s',code); logger.error(message); reject(new Error(message)); } else { @@ -187,7 +184,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha if (!error_message) { let message = util.format( - 'Successfully instantiate chaingcode in organization %s to the channel \'%s\'', + 'Successfully instantiate chaincode in organization %s to the channel \'%s\'', org_name, channelName); logger.info(message); // build a response to send back to the REST caller diff --git a/balance-transfer/app/invoke-transaction.js b/balance-transfer/app/invoke-transaction.js index 9232f70713..a217620995 100644 --- a/balance-transfer/app/invoke-transaction.js +++ b/balance-transfer/app/invoke-transaction.js @@ -14,10 +14,7 @@ * limitations under the License. */ 'use strict'; -var path = require('path'); -var fs = require('fs'); var util = require('util'); -var hfc = require('fabric-client'); var helper = require('./helper.js'); var logger = helper.getLogger('invoke-chaincode'); diff --git a/balance-transfer/app/join-channel.js b/balance-transfer/app/join-channel.js index 4f1e34ed29..b5eedfe9ad 100644 --- a/balance-transfer/app/join-channel.js +++ b/balance-transfer/app/join-channel.js @@ -14,8 +14,6 @@ * limitations under the License. */ var util = require('util'); -var path = require('path'); -var fs = require('fs'); var helper = require('./helper.js'); var logger = helper.getLogger('Join-Channel'); @@ -71,7 +69,7 @@ var joinChannel = async function(channel_name, peers, username, org_name) { if(peer_result.response && peer_result.response.status == 200) { logger.info('Successfully joined peer to the channel %s',channel_name); } else { - let message = util.format('Failed to joined peer to the channel %s',channel_name); + let message = util.format('Failed to join peer to the channel %s',channel_name); error_message = message; logger.error(message); } diff --git a/balance-transfer/app/query.js b/balance-transfer/app/query.js index 8607dde879..3ff950229d 100644 --- a/balance-transfer/app/query.js +++ b/balance-transfer/app/query.js @@ -13,10 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var path = require('path'); -var fs = require('fs'); var util = require('util'); -var hfc = require('fabric-client'); var helper = require('./helper.js'); var logger = helper.getLogger('Query');