Merge pull request #4034 from maciejhirsz/mh-pwmsg

Better error messages for PoA chains, closes #4030
This commit is contained in:
Maciej Hirsz
2017-01-05 11:13:45 +01:00
committed by GitHub
3 changed files with 70 additions and 8 deletions

View File

@@ -150,6 +150,11 @@ impl AccountProvider {
Ok(Address::from(address).into())
}
/// Checks whether an account with a given address is present.
pub fn has_account(&self, address: Address) -> Result<bool, Error> {
Ok(self.accounts()?.iter().any(|&a| a == address))
}
/// Returns addresses of all accounts.
pub fn accounts(&self) -> Result<Vec<Address>, Error> {
let accounts = self.sstore.accounts()?;