[FAB-5913]balance-transfer:Fix query response message

"queryChaincode" doesn’t output responses from all
peers in log message. It exits the loop processing after
outputting the first response.
We should print all responses from all peers. Also, we should
return a response (e.g. the response_payloads[0]) after the loop.

This patch fixes the problems above.

Change-Id: I92a0c5a663d6da0854d89bf76c5ba36da86754ef
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
This commit is contained in:
Yuki Kondo 2017-08-24 20:17:18 +00:00
parent ff5d80bcdc
commit 948e2372b8

View file

@ -44,9 +44,9 @@ var queryChaincode = async function(peer, channelName, chaincodeName, args, fcn,
for (let i = 0; i < response_payloads.length; i++) {
logger.info(args[0]+' now has ' + response_payloads[i].toString('utf8') +
' after the move');
return args[0]+' now has ' + response_payloads[i].toString('utf8') +
' after the move';
}
return args[0]+' now has ' + response_payloads[0].toString('utf8') +
' after the move';
} else {
logger.error('response_payloads is null');
return 'response_payloads is null';