Skip to content

Commit

Permalink
Update SetEvent documentation (#399)
Browse files Browse the repository at this point in the history
Update SetEvent documentation to indicate that only a single
chaincode event can be included in a transaction.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed May 16, 2023
1 parent 6f66124 commit cf179e7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libraries/fabric-shim/lib/stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,15 @@ class ChaincodeStub {
}

/**
* Allows the chaincode to propose an event on the transaction proposal. When the transaction
* is included in a block and the block is successfully committed to the ledger, the block event
* will be delivered to the current event listeners that have been registered with the peer's
* event producer. Note that the block event gets delivered to the listeners regardless of the
* status of the included transactions (can be either valid or invalid), so client applications
* are responsible for checking the validity code on each transaction. Consult each SDK's documentation
* for details.
* Allows the chaincode to propose an event on the transaction proposal response.
* When the transaction is included in a block and the block is successfully committed to the ledger,
* the block event (including transaction level chaincode events)
* will be delivered to the current client application event listeners that have been registered with the peer's event producer.
* Consult each SDK's documentation for details.
* Only a single chaincode event can be included in a transaction.
* If setEvent() is called multiple times only the last event will be included in the transaction.
* The event must originate from the outer-most invoked chaincode in chaincode-to-chaincode scenarios.
* The marshaled ChaincodeEvent will be available in the transaction's ChaincodeAction.events field.
* @param {string} name Name of the event
* @param {byte[]} payload A payload can be used to include data about the event
*/
Expand Down

0 comments on commit cf179e7

Please sign in to comment.