wearetheledger / fabric-mock-stub

Mock implementation of the fabric-shim stub for testing
https://theledger.be
MIT License
49 stars 28 forks source link

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

Open Jojoooo1 opened 5 years ago

Jojoooo1 commented 5 years ago
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.

sneljo1 commented 5 years ago

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