Skip to content

Commit

Permalink
nodeSDK Fixes for FAB-1702 and FAB-1704
Browse files Browse the repository at this point in the history
FAB-1702 and FAB-1704 both report attempts to dereference null pointers.

Edit: Indicate that FAB-1704 fix is added to this fix.  This resolves conflicts between FAB-1702 and FAB-1704.
Edit2: Inspection rework
Edit3: resolve merge conflicts

Change-Id: I29f699ccf8804a6fec9036cbf1c31ef909927e02
Signed-off-by: jjjjibm <[email protected]>
  • Loading branch information
jjjjibm committed Jan 31, 2017
1 parent 6ef5737 commit 6f74833
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/unit/end-to-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,23 @@ test('End-to-end flow of chaincode deploy, transaction invocation, and query', f
}
).then(
function(results) {
var proposalResponses = results[0];
var proposal = results[1];
var header = results[2];

var all_good = true;
for(var i in proposalResponses) {
let one_good = false;
if (proposalResponses && proposalResponses[i].response && proposalResponses[i].response.status === 200) {
one_good = true;
logger.info('move proposal was good');
} else {
logger.error('move proposal was bad');
var all_good = false;
if (results) {
var proposalResponses = results[0];
var proposal = results[1];
var header = results[2];

all_good = true;
for(var i in proposalResponses) {
let one_good = false;
if (proposalResponses && proposalResponses[i].response && proposalResponses[i].response.status === 200) {
one_good = true;
logger.info('move proposal was good');
} else {
logger.error('move proposal was bad');
}
all_good = all_good & one_good;
}
all_good = all_good & one_good;
}
if (all_good) {
t.pass('Successfully obtained transaction endorsements.'); // + JSON.stringify(proposalResponses));
Expand All @@ -253,7 +256,8 @@ test('End-to-end flow of chaincode deploy, transaction invocation, and query', f
};
return chain.sendTransaction(request);
} else {
t.fail('Failed to obtain transaction endorsements. Error code: ' + results);
t.fail('Failed to obtain transaction endorsements. Error code: '
+ (results ? results : 'Results are null'));
t.end();
}
},
Expand All @@ -265,7 +269,6 @@ test('End-to-end flow of chaincode deploy, transaction invocation, and query', f
function(response) {
if (response.status === 'SUCCESS') {
t.pass('Successfully ordered endorsement transaction.');

return new Promise((resolve, reject) => {
var handle = setTimeout(reject, 30000);

Expand Down

0 comments on commit 6f74833

Please sign in to comment.