mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Add pallet names to Events (#10296)
* chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * fix: add fix to tests for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: updated transaction-storage pallet event variants * chore: updated transaction-storage pallet event variants * chore: formatted contracts pallet * chore: update treasury event variants
This commit is contained in:
@@ -203,12 +203,16 @@ pub mod pallet {
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// Scheduled some task. \[when, index\]
|
||||
Scheduled(T::BlockNumber, u32),
|
||||
/// Canceled some task. \[when, index\]
|
||||
Canceled(T::BlockNumber, u32),
|
||||
/// Dispatched some task. \[task, id, result\]
|
||||
Dispatched(TaskAddress<T::BlockNumber>, Option<Vec<u8>>, DispatchResult),
|
||||
/// Scheduled some task.
|
||||
Scheduled { when: T::BlockNumber, index: u32 },
|
||||
/// Canceled some task.
|
||||
Canceled { when: T::BlockNumber, index: u32 },
|
||||
/// Dispatched some task.
|
||||
Dispatched {
|
||||
task: TaskAddress<T::BlockNumber>,
|
||||
id: Option<Vec<u8>>,
|
||||
result: DispatchResult,
|
||||
},
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
@@ -319,11 +323,11 @@ pub mod pallet {
|
||||
Lookup::<T>::remove(id);
|
||||
}
|
||||
}
|
||||
Self::deposit_event(Event::Dispatched(
|
||||
(now, index),
|
||||
maybe_id,
|
||||
r.map(|_| ()).map_err(|e| e.error),
|
||||
));
|
||||
Self::deposit_event(Event::Dispatched {
|
||||
task: (now, index),
|
||||
id: maybe_id,
|
||||
result: r.map(|_| ()).map_err(|e| e.error),
|
||||
});
|
||||
total_weight = cumulative_weight;
|
||||
None
|
||||
} else {
|
||||
@@ -563,7 +567,7 @@ impl<T: Config> Pallet<T> {
|
||||
expected from the runtime configuration. An update might be needed.",
|
||||
);
|
||||
}
|
||||
Self::deposit_event(Event::Scheduled(when, index));
|
||||
Self::deposit_event(Event::Scheduled { when, index });
|
||||
|
||||
Ok((when, index))
|
||||
}
|
||||
@@ -592,7 +596,7 @@ impl<T: Config> Pallet<T> {
|
||||
if let Some(id) = s.maybe_id {
|
||||
Lookup::<T>::remove(id);
|
||||
}
|
||||
Self::deposit_event(Event::Canceled(when, index));
|
||||
Self::deposit_event(Event::Canceled { when, index });
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::<T>::NotFound)?
|
||||
@@ -617,8 +621,8 @@ impl<T: Config> Pallet<T> {
|
||||
})?;
|
||||
|
||||
let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
|
||||
Self::deposit_event(Event::Canceled(when, index));
|
||||
Self::deposit_event(Event::Scheduled(new_time, new_index));
|
||||
Self::deposit_event(Event::Canceled { when, index });
|
||||
Self::deposit_event(Event::Scheduled { when: new_time, index: new_index });
|
||||
|
||||
Ok((new_time, new_index))
|
||||
}
|
||||
@@ -663,7 +667,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
let address = (when, index);
|
||||
Lookup::<T>::insert(&id, &address);
|
||||
Self::deposit_event(Event::Scheduled(when, index));
|
||||
Self::deposit_event(Event::Scheduled { when, index });
|
||||
|
||||
Ok(address)
|
||||
}
|
||||
@@ -686,7 +690,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
Self::deposit_event(Event::Canceled(when, index));
|
||||
Self::deposit_event(Event::Canceled { when, index });
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::<T>::NotFound)?
|
||||
@@ -718,8 +722,8 @@ impl<T: Config> Pallet<T> {
|
||||
})?;
|
||||
|
||||
let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
|
||||
Self::deposit_event(Event::Canceled(when, index));
|
||||
Self::deposit_event(Event::Scheduled(new_time, new_index));
|
||||
Self::deposit_event(Event::Canceled { when, index });
|
||||
Self::deposit_event(Event::Scheduled { when: new_time, index: new_index });
|
||||
|
||||
*lookup = Some((new_time, new_index));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user