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

Commit

Permalink
Split the method to avoid confusing type error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw committed Dec 3, 2019
1 parent 0c4c037 commit dc8d71c
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions frame/system/src/offchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,31 @@ pub trait SubmitSignedTransaction<T: crate::Trait, Call> {
///
/// Returns a vector of results and account ids that were supported.
#[must_use]
fn submit_signed(
fn submit_signed_from(
call: impl Into<Call> + Clone,
accounts: Option<impl IntoIterator<Item= T::AccountId>>,
accounts: impl IntoIterator<Item= T::AccountId>,
) -> Vec<(T::AccountId, Result<(), ()>)> {
let keys = Self::find_local_keys(accounts);
let keys = Self::find_local_keys(Some(accounts));
keys.into_iter().map(|(account, pub_key)| {
let call = call.clone().into();
(
account,
Self::SignAndSubmit::sign_and_submit(call, pub_key)
)
}).collect()
}

/// Create and submit signed transactions from all local accounts.
///
/// This method submits a signed transaction from all local accounts
/// for given application crypto.
///
/// Returns a vector of results and account ids that were supported.
#[must_use]
fn submit_signed(
call: impl Into<Call> + Clone,
) -> Vec<(T::AccountId, Result<(), ()>)> {
let keys = Self::find_local_keys(None as Option<Vec<_>>);
keys.into_iter().map(|(account, pub_key)| {
let call = call.clone().into();
(
Expand Down

0 comments on commit dc8d71c

Please sign in to comment.