Skip to content

Commit

Permalink
[FAB-6777] Incorrect comment about cc events
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wlahti committed Dec 7, 2017
1 parent 809b79f commit 0e40ff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions core/chaincode/shim/interfaces_experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ type ChaincodeStubInterface interface {
// client's timestamp, and will have the same value across all endorsers.
GetTxTimestamp() (*timestamp.Timestamp, error)

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

Expand Down
7 changes: 4 additions & 3 deletions core/chaincode/shim/interfaces_stable.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ type ChaincodeStubInterface interface {
// client's timestamp, and will have the same value across all endorsers.
GetTxTimestamp() (*timestamp.Timestamp, error)

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

Expand Down

0 comments on commit 0e40ff2

Please sign in to comment.