Open thebubbleindex opened 5 years ago
Maybe you can fix deletePrivateData and it will work.
fabric-mock-stub/src/ChaincodeMockStub.ts
deletePrivateData(collection: string, key: string): Promise<any> {
const value = (this.privateCollections[collection] || {})[key];
if (value) {
// (this.privateCollections[collection] as StateMap).delete(key); // ← Incorrect !!
delete this.privateCollections[collection][key];
}
return Promise.resolve();
}
Hi, I am encountering an issue in using the private data collection functionality. I realize this is a newer feature, however, I am wondering if all the functionality is implemented? Can private data collection entries be deleted in the fabric-mock-stub package? In particular, I am able to use the putPrivateData and getPrivateData functions, but the deletePrivateData does not seem to delete the key from the collection. I tried:
However the final query is returning the "5678" value. But it is supposed to fail. Thanks