mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
[FAB-16528] marbles private chaincode sync up
This CR is part 2 of porting changes in marbles private in fabric/integration by FAB-15894 back to fabric-samples Signed-off-by: Dongming <dongming@ibm.com> Change-Id: Ic823bdf4c3c571f43b4700452c50fd4283d35262
This commit is contained in:
parent
3fad853c15
commit
c13a5ec8f6
1 changed files with 7 additions and 9 deletions
|
|
@ -523,18 +523,16 @@ func (t *SimpleChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, ar
|
|||
return shim.Error(err.Error())
|
||||
}
|
||||
// Add a comma before array members, suppress it for the first array member
|
||||
if bArrayMemberAlreadyWritten == true {
|
||||
if bArrayMemberAlreadyWritten {
|
||||
buffer.WriteString(",")
|
||||
}
|
||||
buffer.WriteString("{\"Key\":")
|
||||
buffer.WriteString("\"")
|
||||
buffer.WriteString(queryResponse.Key)
|
||||
buffer.WriteString("\"")
|
||||
|
||||
buffer.WriteString(", \"Record\":")
|
||||
// Record is a JSON object, so we write as-is
|
||||
buffer.WriteString(string(queryResponse.Value))
|
||||
buffer.WriteString("}")
|
||||
buffer.WriteString(
|
||||
fmt.Sprintf(
|
||||
`{"Key":"%s", "Record":%s}`,
|
||||
queryResponse.Key, queryResponse.Value,
|
||||
),
|
||||
)
|
||||
bArrayMemberAlreadyWritten = true
|
||||
}
|
||||
buffer.WriteString("]")
|
||||
|
|
|
|||
Loading…
Reference in a new issue