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

Commit dc8d71c

Browse files
committed
Split the method to avoid confusing type error message.
1 parent 0c4c037 commit dc8d71c

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

frame/system/src/offchain.rs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,31 @@ pub trait SubmitSignedTransaction<T: crate::Trait, Call> {
193193
///
194194
/// Returns a vector of results and account ids that were supported.
195195
#[must_use]
196-
fn submit_signed(
196+
fn submit_signed_from(
197197
call: impl Into<Call> + Clone,
198-
accounts: Option<impl IntoIterator<Item= T::AccountId>>,
198+
accounts: impl IntoIterator<Item= T::AccountId>,
199199
) -> Vec<(T::AccountId, Result<(), ()>)> {
200-
let keys = Self::find_local_keys(accounts);
200+
let keys = Self::find_local_keys(Some(accounts));
201+
keys.into_iter().map(|(account, pub_key)| {
202+
let call = call.clone().into();
203+
(
204+
account,
205+
Self::SignAndSubmit::sign_and_submit(call, pub_key)
206+
)
207+
}).collect()
208+
}
201209

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

0 commit comments

Comments
 (0)