Better error messages for PoA chains

This commit is contained in:
maciejhirsz
2017-01-04 12:50:50 +01:00
parent 4c532f9e3d
commit 8ca0e09ffc
2 changed files with 18 additions and 1 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()?;