maidsafe / self_encryption

file self encryptor
Other
118 stars 70 forks source link

Delete trait for SEStorage #304

Closed kanav99 closed 3 years ago

kanav99 commented 3 years ago

Implements delete trait for Storage which is needed for https://github.com/maidsafe/sn_client/pull/1377 This PR needs some tests.

lionel-faber commented 3 years ago

Looks good so far. But I think that the delete() function is missing from the SelfEncryptor struct. I imagine that the API would be something like:

let encryptor = SelfEncryptor::new(client, root_data_map);
encryptor.delete();
kanav99 commented 3 years ago

I thought that would go in the client, but I think this makes more sense. How should the state of the encryptor look like after delete? should we be able to write to it? or should it be closed?

lionel-faber commented 3 years ago

I think we can close the self encryptor after calling delete. It can consume the object instead of taking a reference.

lionel-faber commented 3 years ago

This looks good. It'd be nice to add some tests to this.