Clearer updates handling

This commit is contained in:
Tomasz Drwięga
2016-12-09 08:31:58 +00:00
parent 93230dd4c2
commit 8596134c0f
7 changed files with 63 additions and 26 deletions

View File

@@ -105,6 +105,11 @@ impl KeyDirectory for DiskDirectory {
Ok(accounts)
}
fn update(&self, account: SafeAccount) -> Result<SafeAccount, Error> {
// Disk store handles updates correctly iff filename is the same
self.insert(account)
}
fn insert(&self, account: SafeAccount) -> Result<SafeAccount, Error> {
// transform account into key file
let keyfile: json::KeyFile = account.clone().into();