Skip to content

Commit 833acdb

Browse files
joojiskseo
authored andcommitted
Fix has_account()
1 parent 90b3821 commit 833acdb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

keystore/src/keystore.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ impl SimpleSecretStore for KeyMultiStore {
345345
}
346346

347347
fn has_account(&self, account: &Address) -> Result<bool, Error> {
348-
let mut accounts = self.get_accounts(account)?.into_iter();
349-
match accounts.next() {
350-
Some(_) => Ok(true),
351-
None => Ok(false),
348+
match self.get_accounts(account) {
349+
Ok(_) => Ok(true),
350+
Err(Error::InvalidAccount) => Ok(false),
351+
Err(e) => Err(e),
352352
}
353353
}
354354

0 commit comments

Comments
 (0)