Skip to content

Commit 449a18b

Browse files
committed
[FAB-10559] fix iter in GetPrivateDataQueryResult
While creating an iterator for GetPrivateDataQueryResult in the chaincode shim, we incorrectly assign value to fields in the iterator object. For e.g., we assign channelID to the txid field and txid to the channelID field. As a result, the peer is unable to get the txcontext while processing the iter.next() and iter.close() call from the shim. This CR creates the correct iterator object and pass it to the chaincode. Change-Id: I360ad3e0768dd6f2bef8439d06d3967225f88a12 Signed-off-by: senthil <cendhu@gmail.com>
1 parent 8b19d4e commit 449a18b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/chaincode/shim/chaincode.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,11 @@ func (stub *ChaincodeStub) GetPrivateDataQueryResult(collection, query string) (
504504
if err != nil {
505505
return nil, err
506506
}
507-
return &StateQueryIterator{CommonIterator: &CommonIterator{stub.handler, stub.TxID, stub.ChannelId, response, 0}}, nil
507+
return &StateQueryIterator{CommonIterator: &CommonIterator{
508+
handler: stub.handler,
509+
channelId: stub.ChannelId,
510+
txid: stub.TxID,
511+
response: response}}, nil
508512
}
509513

510514
// CommonIterator documentation can be found in interfaces.go

0 commit comments

Comments
 (0)