Skip to content

Commit bb958eb

Browse files
author
Luis Sanchez
committed
[FAB-8346] sync chaincode proto files w/ fabric
Change-Id: I5ca3482ac98d53937d011cee85f67941a9bd119d Signed-off-by: Luis Sanchez <sanchezl@us.ibm.com>
1 parent 308eb63 commit bb958eb

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

shim/src/main/java/org/hyperledger/fabric/shim/impl/Handler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ private static ChaincodeMessage newGetStateEventMessage(final String channelId,
488488
}
489489

490490
private static ChaincodeMessage newPutStateEventMessage(final String channelId, final String txId, final String key, final ByteString value) {
491-
return newEventMessage(PUT_STATE, channelId, txId, PutStateInfo.newBuilder()
491+
return newEventMessage(PUT_STATE, channelId, txId, PutState.newBuilder()
492492
.setKey(key)
493493
.setValue(value)
494494
.build().toByteString());

shim/src/main/proto/common/common.proto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum Status {
3232
NOT_FOUND = 404;
3333
REQUEST_ENTITY_TOO_LARGE = 413;
3434
INTERNAL_SERVER_ERROR = 500;
35+
NOT_IMPLEMENTED = 501;
3536
SERVICE_UNAVAILABLE = 503;
3637
}
3738

@@ -43,6 +44,7 @@ enum HeaderType {
4344
ORDERER_TRANSACTION = 4; // Used internally by the orderer for management
4445
DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek
4546
CHAINCODE_PACKAGE = 6; // Used for packaging chaincode artifacts for install
47+
PEER_RESOURCE_UPDATE = 7; // Used for encoding updates to the peer resource configuration
4648
}
4749

4850
// This enum enlists indexes of the block metadata array
@@ -108,10 +110,14 @@ message ChannelHeader {
108110

109111
// Extension that may be attached based on the header type
110112
bytes extension = 7;
113+
114+
// If mutual TLS is employed, this represents
115+
// the hash of the client's TLS certificate
116+
bytes tls_cert_hash = 8;
111117
}
112118

113119
message SignatureHeader {
114-
// Creator of the message, specified as a certificate chain
120+
// Creator of the message, a marshaled msp.SerializedIdentity
115121
bytes creator = 1;
116122

117123
// Arbitrary number that may only be used once. Can be used to detect replay attacks.

shim/src/main/proto/peer/chaincode_shim.proto

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
/*
2-
Copyright IBM Corp. 2017 All Rights Reserved.
2+
Copyright IBM Corp. All Rights Reserved.
33
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.
4+
SPDX-License-Identifier: Apache-2.0
155
*/
166

177
syntax = "proto3";
@@ -55,7 +45,7 @@ message ChaincodeMessage {
5545

5646
SignedProposal proposal = 5;
5747

58-
//event emmited by chaincode. Used only with Init or Invoke.
48+
//event emitted by chaincode. Used only with Init or Invoke.
5949
// This event is then stored (currently)
6050
//with Block.NonHashData.TransactionResult
6151
ChaincodeEvent chaincode_event = 6;
@@ -64,18 +54,34 @@ message ChaincodeMessage {
6454
string channel_id = 7;
6555
}
6656

67-
message PutStateInfo {
57+
// TODO: We need to finalize the design on chaincode container
58+
// compatibility upon upgrade, see FAB-5777.
59+
60+
message GetState {
61+
string key = 1;
62+
string collection = 2;
63+
}
64+
65+
message PutState {
6866
string key = 1;
6967
bytes value = 2;
68+
string collection = 3;
69+
}
70+
71+
message DelState {
72+
string key = 1;
73+
string collection = 2;
7074
}
7175

7276
message GetStateByRange {
7377
string startKey = 1;
7478
string endKey = 2;
79+
string collection = 3;
7580
}
7681

7782
message GetQueryResult {
7883
string query = 1;
84+
string collection = 2;
7985
}
8086

8187
message GetHistoryForKey {

0 commit comments

Comments
 (0)