Skip to content

Commit e99d18e

Browse files
author
Jason Yellick
committed
[FAB-5113] Clarify chaincode GetState doc
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 <[email protected]>
1 parent b93fb81 commit e99d18e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/chaincode/shim/interfaces.go

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type ChaincodeStubInterface interface {
8383
// ledger. Note that GetState doesn't read data from the writeset, which
8484
// has not been committed to the ledger. In other words, GetState doesn't
8585
// consider data modified by PutState that has not been committed.
86+
// If the key does not exist in the state database, (nil, nil) is returned.
8687
GetState(key string) ([]byte, error)
8788

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

0 commit comments

Comments
 (0)