Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Remove invalid expectation (beta) #4542

Merged
merged 1 commit into from
Feb 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ethstore/src/ethstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ impl SimpleSecretStore for EthMultiStore {
// Remove from cache
let mut cache = self.cache.write();
let is_empty = {
let mut accounts = cache.get_mut(address).expect("Entry exists, because it was returned by `get`; qed");
let mut accounts = cache.get_mut(address)
.ok_or(Error::InvalidAccount)?;

if let Some(position) = accounts.iter().position(|acc| acc == &account) {
accounts.remove(position);
}
Expand Down