mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
pub keystore_accounts/accounts_from_keys for offchain Signer (#2051)
This commit is contained in:
@@ -154,8 +154,8 @@ impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Signer<T, C, X>
|
||||
/// all available accounts and the provided accounts
|
||||
/// in `with_filter`. If no accounts are provided,
|
||||
/// use all accounts by default.
|
||||
fn accounts_from_keys<'a>(&'a self) -> Box<dyn Iterator<Item = Account<T>> + 'a> {
|
||||
let keystore_accounts = self.keystore_accounts();
|
||||
pub fn accounts_from_keys<'a>(&'a self) -> Box<dyn Iterator<Item = Account<T>> + 'a> {
|
||||
let keystore_accounts = Self::keystore_accounts();
|
||||
match self.accounts {
|
||||
None => Box::new(keystore_accounts),
|
||||
Some(ref keys) => {
|
||||
@@ -175,7 +175,8 @@ impl<T: SigningTypes, C: AppCrypto<T::Public, T::Signature>, X> Signer<T, C, X>
|
||||
}
|
||||
}
|
||||
|
||||
fn keystore_accounts(&self) -> impl Iterator<Item = Account<T>> {
|
||||
/// Return all available accounts in keystore.
|
||||
pub fn keystore_accounts() -> impl Iterator<Item = Account<T>> {
|
||||
C::RuntimeAppPublic::all().into_iter().enumerate().map(|(index, key)| {
|
||||
let generic_public = C::GenericPublic::from(key);
|
||||
let public: T::Public = generic_public.into();
|
||||
|
||||
Reference in New Issue
Block a user