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

Commit

Permalink
Remove un-needed index field for utility.ItemFailed event
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Apr 4, 2022
1 parent 2f3df99 commit e5a7a56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frame/utility/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub mod pallet {
/// A single item within a Batch of dispatches has completed with no error.
ItemCompleted,
/// A single item within a Batch of dispatches has completed with error.
ItemFailed { index: u32, error: DispatchError },
ItemFailed { error: DispatchError },
/// A call was dispatched.
DispatchedAs { result: DispatchResult },
}
Expand Down Expand Up @@ -446,7 +446,7 @@ pub mod pallet {
weight = weight.saturating_add(extract_actual_weight(&result, &info));
if let Err(e) = result {
error_indexes.push(index as u32);
Self::deposit_event(Event::ItemFailed { index: index as u32, error: e.error });
Self::deposit_event(Event::ItemFailed { error: e.error });
} else {
Self::deposit_event(Event::ItemCompleted);
}
Expand Down
2 changes: 1 addition & 1 deletion frame/utility/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn force_batch_works() {
utility::Event::BatchCompletedWithErrors { indexes: vec![1, 2] }.into(),
);
System::assert_has_event(
utility::Event::ItemFailed { index: 1, error: DispatchError::Other("") }.into(),
utility::Event::ItemFailed { error: DispatchError::Other("") }.into(),
);
assert_eq!(Balances::free_balance(1), 0);
assert_eq!(Balances::free_balance(2), 20);
Expand Down

0 comments on commit e5a7a56

Please sign in to comment.