kalleknast / Microgrid

Hyperledger network for microgrids
GNU General Public License v3.0
4 stars 1 forks source link

json.Unmarshal(bidsAsBytes, &bids) error when quering getBidsByRange() from getMCP() #6

Open kalleknast opened 5 years ago

kalleknast commented 5 years ago

Line 95 in MCP.go (err := json.Unmarshal(bidsAsBytes, &bids)) fails with

Error: endorsement failure during query. response: status:500 message:'Failed to parse bidsAsBytes. Got error: invalid character 'I' looking for beginning of value'

i.e. something is funny with

response := stub.InvokeChaincode("getBidsByRange", invokeArgs, channelID)
bidsAsBytes := response.GetPayload()

I checked the documentation for shim and peer.Response but cannot figure out what is wrong.