fabric-mock-stub icon indicating copy to clipboard operation
fabric-mock-stub copied to clipboard

set key to default "" in order for iterator not to fail

Open Jojoooo1 opened this issue 5 years ago • 1 comments

async getHistoryForKey (key) {
   return await this.handler.handleGetHistoryForKey(key, this.channel_id, this.txId);
}

if key does not exist it will return a MockHistoryQueryIterator where data is undefined { data: undefined, [...] } which will cause errors when executing the iterator.

Jojoooo1 avatar Jul 23 '19 21:07 Jojoooo1

Is this the behaviour of the actual chaincode? or should this be an empty array?

sneljo1 avatar Aug 01 '19 06:08 sneljo1