Skip to content

Commit

Permalink
[FAB-1486] Avoid duplicated transaction in e2e
Browse files Browse the repository at this point in the history
Add peers to the chain just once before entire transactions.

The prior code adds peers twice and the step2 fails due to a
duplicated transaction.

Fix Issue # FAB-1486.
https://jira.hyperledger.org/browse/FAB-1486

Change-Id: I712c032d7afcf8936ead8a3b204b1464e7097de3
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
  • Loading branch information
inatatsu committed Dec 29, 2016
1 parent 87301d8 commit 5786857
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/unit/end-to-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ logger.info('Found steps: %s', steps);
testUtil.setupChaincodeDeploy();

chain.addOrderer(new Orderer('grpc://localhost:7050'));
chain.addPeer(peer0);
chain.addPeer(peer1);

test('End-to-end flow of chaincode deploy, transaction invocation, and query', function(t) {
var promise = testUtil.getSubmitter(client, t);
Expand All @@ -74,8 +76,6 @@ test('End-to-end flow of chaincode deploy, transaction invocation, and query', f
webUser = admin;
tx_id = utils.buildTransactionID({length:12});
nonce = utils.getNonce();
chain.addPeer(peer0);
chain.addPeer(peer1);

// send proposal to endorser
var request = {
Expand Down Expand Up @@ -182,8 +182,6 @@ test('End-to-end flow of chaincode deploy, transaction invocation, and query', f
function() {
tx_id = utils.buildTransactionID({length:12});
nonce = utils.getNonce();
chain.addPeer(peer0);
chain.addPeer(peer1);
// send proposal to endorser
var request = {
chaincodeId : chaincode_id,
Expand Down

0 comments on commit 5786857

Please sign in to comment.