mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 01:25:10 +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())
|
return shim.Error(err.Error())
|
||||||
}
|
}
|
||||||
// Add a comma before array members, suppress it for the first array member
|
// Add a comma before array members, suppress it for the first array member
|
||||||
if bArrayMemberAlreadyWritten == true {
|
if bArrayMemberAlreadyWritten {
|
||||||
buffer.WriteString(",")
|
buffer.WriteString(",")
|
||||||
}
|
}
|
||||||
buffer.WriteString("{\"Key\":")
|
|
||||||
buffer.WriteString("\"")
|
|
||||||
buffer.WriteString(queryResponse.Key)
|
|
||||||
buffer.WriteString("\"")
|
|
||||||
|
|
||||||
buffer.WriteString(", \"Record\":")
|
buffer.WriteString(
|
||||||
// Record is a JSON object, so we write as-is
|
fmt.Sprintf(
|
||||||
buffer.WriteString(string(queryResponse.Value))
|
`{"Key":"%s", "Record":%s}`,
|
||||||
buffer.WriteString("}")
|
queryResponse.Key, queryResponse.Value,
|
||||||
|
),
|
||||||
|
)
|
||||||
bArrayMemberAlreadyWritten = true
|
bArrayMemberAlreadyWritten = true
|
||||||
}
|
}
|
||||||
buffer.WriteString("]")
|
buffer.WriteString("]")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue