Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit eb8eeac

Browse files
committed
FAB-938 Catch up e2e test to latest Peer protobuf
Due to the changes in protobuf definitions around proposal response and Transaction object, the end-to-end test that has the code to build the Transaction object from ProposalResponse must be updated to work with the latest Peer code. Also removed unused old proto files. Change-Id: Ib1ba0c0e504a4ce10d7c1069380c9b90640b0e38 Signed-off-by: Jim Zhang <jzhang@us.ibm.com>
1 parent 3ca4e6f commit eb8eeac

13 files changed

+183
-852
lines changed

lib/Member.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ var Member = class {
459459
let peer = new Peer(request.endorserUrl);
460460
return peer.sendProposal(proposal)
461461
.then(
462-
function(response) {
463-
resolve(response);
462+
function(data) {
463+
resolve(data);
464464
}
465465
);
466466
}

lib/Peer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ var Peer = class extends Remote {
6565
} else {
6666
if (response) {
6767
logger.info('Received proposal response: code - %s', JSON.stringify(response.response.status));
68-
resolve(response);
68+
// return the original proposal payload along with the response, so that
69+
// it can be used to construct the Transaction object
70+
resolve([response, proposal.payload]);
6971
} else {
7072
logger.error('GRPC client failed to get a proper response from the peer.');
7173
reject(new Error('GRPC client failed to get a proper response from the peer.'));

lib/protos/api.proto

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright IBM Corp. 2016 All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
syntax = "proto3";
18+
19+
package protos;
20+
21+
import "fabric_proposal_response.proto";
22+
23+
// ChaincodeActionPayload is the message to be used for the TransactionAction's
24+
// payload when the Header's type is set to CHAINCODE. It carries the
25+
// chaincodeProposalPayload and an endorsed action to apply to the ledger.
26+
message ChaincodeActionPayload {
27+
28+
// This field contains the bytes of the ChaincodeProposalPayload message from
29+
// the original invocation (essentially the arguments) after the application
30+
// of the visibility function. The main visibility modes are "full" (the
31+
// entire ChaincodeProposalPayload message is included here), "hash" (only
32+
// the hash of the ChaincodeProposalPayload message is included) or
33+
// "nothing". This field will be used to check the consistency of
34+
// ProposalResponsePayload.proposalHash. For the CHAINCODE type,
35+
// ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader ||
36+
// f(ChaincodeProposalPayload)) where f is the visibility function.
37+
bytes chaincodeProposalPayload = 1;
38+
39+
// The list of actions to apply to the ledger
40+
ChaincodeEndorsedAction action = 2;
41+
}
42+
43+
// ChaincodeEndorsedAction carries information about the endorsement of a
44+
// specific proposal
45+
message ChaincodeEndorsedAction {
46+
47+
// This is the bytes of the ProposalResponsePayload message signed by the
48+
// endorsers. Recall that for the CHAINCODE type, the
49+
// ProposalResponsePayload's extenstion field carries a ChaincodeAction
50+
bytes proposalResponsePayload = 1;
51+
52+
// The endorsement of the proposal, basically the endorser's signature over
53+
// proposalResponsePayload
54+
repeated Endorsement endorsements = 2;
55+
}

lib/protos/chaincodeevent.proto

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ message ChaincodeEvent {
2424
string txID = 2;
2525
string eventName = 3;
2626
bytes payload = 4;
27-
}
27+
}

lib/protos/devops.proto

Lines changed: 0 additions & 97 deletions
This file was deleted.

lib/protos/events.proto

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)