Skip to content

Commit

Permalink
FAB-11518
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
clydedcruz committed Aug 8, 2018
1 parent 5930dfc commit bfdc0b6
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion balance-transfer/app/create-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
10 changes: 0 additions & 10 deletions balance-transfer/app/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions balance-transfer/app/install-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = {
Expand Down
7 changes: 2 additions & 5 deletions balance-transfer/app/instantiate-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions balance-transfer/app/invoke-transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
4 changes: 1 addition & 3 deletions balance-transfer/app/join-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 0 additions & 3 deletions balance-transfer/app/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit bfdc0b6

Please sign in to comment.