Skip to content

Commit 0e40ff2

Browse files
committed
[FAB-6777] Incorrect comment about cc events
This CR updates the comment for SetEvent to ensure it accurately reflects the expected result of setting a chaincode event. It previously stated that a chaincode event would only be sent if the transaction was validated, which is incorrect. The chaincode event will always be available in the block event whether the transaction was validated or not because these events are stored in the committed block. Change-Id: I0eabc67184b9ef2a4cab8901ee2fd9f0ee2e9d5b Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
1 parent 809b79f commit 0e40ff2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

core/chaincode/shim/interfaces_experimental.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ type ChaincodeStubInterface interface {
252252
// client's timestamp, and will have the same value across all endorsers.
253253
GetTxTimestamp() (*timestamp.Timestamp, error)
254254

255-
// SetEvent allows the chaincode to propose an event on the transaction
256-
// proposal. If the transaction is validated and successfully committed,
257-
// the event will be delivered to the current event listeners.
255+
// SetEvent allows the chaincode to set an event on the response to the
256+
// proposal to be included as part of a transaction. The event will be
257+
// available within the transaction in the committed block regardless of the
258+
// validity of the transaction.
258259
SetEvent(name string, payload []byte) error
259260
}
260261

core/chaincode/shim/interfaces_stable.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ type ChaincodeStubInterface interface {
190190
// client's timestamp, and will have the same value across all endorsers.
191191
GetTxTimestamp() (*timestamp.Timestamp, error)
192192

193-
// SetEvent allows the chaincode to propose an event on the transaction
194-
// proposal. If the transaction is validated and successfully committed,
195-
// the event will be delivered to the current event listeners.
193+
// SetEvent allows the chaincode to set an event on the response to the
194+
// proposal to be included as part of a transaction. The event will be
195+
// available within the transaction in the committed block regardless of the
196+
// validity of the transaction.
196197
SetEvent(name string, payload []byte) error
197198
}
198199

0 commit comments

Comments
 (0)