Skip to content

Commit bfdc0b6

Browse files
committed
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 <clydecroix@gmail.com>
1 parent 5930dfc commit bfdc0b6

7 files changed

+4
-30
lines changed

balance-transfer/app/create-channel.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
var util = require('util');
1716
var fs = require('fs');
1817
var path = require('path');
1918

balance-transfer/app/helper.js

-10
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,9 @@ logger.setLevel('DEBUG');
2020

2121
var path = require('path');
2222
var util = require('util');
23-
var copService = require('fabric-ca-client');
2423

2524
var hfc = require('fabric-client');
2625
hfc.setLogger(logger);
27-
var ORGS = hfc.getConfigSetting('network-config');
28-
29-
var clients = {};
30-
var channels = {};
31-
var caClients = {};
32-
33-
var sleep = async function (sleep_time_ms) {
34-
return new Promise(resolve => setTimeout(resolve, sleep_time_ms));
35-
}
3626

3727
async function getClientForOrg (userorg, username) {
3828
logger.debug('getClientForOrg - ****** START %s %s', userorg, username)

balance-transfer/app/install-chaincode.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@
1414
* limitations under the License.
1515
*/
1616
'use strict';
17-
var path = require('path');
18-
var fs = require('fs');
1917
var util = require('util');
20-
var config = require('../config.json');
2118
var helper = require('./helper.js');
2219
var logger = helper.getLogger('install-chaincode');
23-
var tx_id = null;
2420

2521
var installChaincode = async function(peers, chaincodeName, chaincodePath,
2622
chaincodeVersion, chaincodeType, username, org_name) {
@@ -76,7 +72,7 @@ var installChaincode = async function(peers, chaincodeName, chaincodePath,
7672
}
7773

7874
if (!error_message) {
79-
let message = util.format('Successfully install chaincode');
75+
let message = util.format('Successfully installed chaincode');
8076
logger.info(message);
8177
// build a response to send back to the REST caller
8278
let response = {

balance-transfer/app/instantiate-chaincode.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
'use strict';
17-
var path = require('path');
18-
var fs = require('fs');
1917
var util = require('util');
20-
var hfc = require('fabric-client');
2118
var helper = require('./helper.js');
2219
var logger = helper.getLogger('instantiate-chaincode');
2320

@@ -117,7 +114,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha
117114
clearTimeout(event_timeout);
118115

119116
if (code !== 'VALID') {
120-
let message = until.format('The chaincode instantiate transaction was invalid, code:%s',code);
117+
let message = util.format('The chaincode instantiate transaction was invalid, code:%s',code);
121118
logger.error(message);
122119
reject(new Error(message));
123120
} else {
@@ -187,7 +184,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha
187184

188185
if (!error_message) {
189186
let message = util.format(
190-
'Successfully instantiate chaingcode in organization %s to the channel \'%s\'',
187+
'Successfully instantiate chaincode in organization %s to the channel \'%s\'',
191188
org_name, channelName);
192189
logger.info(message);
193190
// build a response to send back to the REST caller

balance-transfer/app/invoke-transaction.js

-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
'use strict';
17-
var path = require('path');
18-
var fs = require('fs');
1917
var util = require('util');
20-
var hfc = require('fabric-client');
2118
var helper = require('./helper.js');
2219
var logger = helper.getLogger('invoke-chaincode');
2320

balance-transfer/app/join-channel.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
var util = require('util');
17-
var path = require('path');
18-
var fs = require('fs');
1917

2018
var helper = require('./helper.js');
2119
var logger = helper.getLogger('Join-Channel');
@@ -71,7 +69,7 @@ var joinChannel = async function(channel_name, peers, username, org_name) {
7169
if(peer_result.response && peer_result.response.status == 200) {
7270
logger.info('Successfully joined peer to the channel %s',channel_name);
7371
} else {
74-
let message = util.format('Failed to joined peer to the channel %s',channel_name);
72+
let message = util.format('Failed to join peer to the channel %s',channel_name);
7573
error_message = message;
7674
logger.error(message);
7775
}

balance-transfer/app/query.js

-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
var path = require('path');
17-
var fs = require('fs');
1816
var util = require('util');
19-
var hfc = require('fabric-client');
2017
var helper = require('./helper.js');
2118
var logger = helper.getLogger('Query');
2219

0 commit comments

Comments
 (0)