fabric-mock-stub
fabric-mock-stub copied to clipboard
set key to default "" in order for iterator not to fail
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.
Is this the behaviour of the actual chaincode? or should this be an empty array?