Skip to content

Commit

Permalink
[FAB-5113] Clarify chaincode GetState doc
Browse files Browse the repository at this point in the history
The current documentation does not make it clear what the behavior of
GetState is when the key does not exist.  This CR simply adds another
line to the documentation indicating that (nil, nil) will be returned so
that the chaincode developer does not have to guess or test this
behavior.

Change-Id: Ic610c3c488bd2b45482371231744c7a5579c7137
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Jun 29, 2017
1 parent b93fb81 commit e99d18e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/chaincode/shim/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type ChaincodeStubInterface interface {
// ledger. Note that GetState doesn't read data from the writeset, which
// has not been committed to the ledger. In other words, GetState doesn't
// consider data modified by PutState that has not been committed.
// If the key does not exist in the state database, (nil, nil) is returned.
GetState(key string) ([]byte, error)

// PutState puts the specified `key` and `value` into the transaction's
Expand Down

0 comments on commit e99d18e

Please sign in to comment.