Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Jul 31, 2023
1 parent 8d1e831 commit 46bc6ea
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pallets/migrations/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ parameter_types! {
pub struct MockMigrationManager<'test> {
name_fn_callbacks: Vec<Box<dyn 'test + FnMut() -> &'static str>>,
migrate_fn_callbacks: Vec<Box<dyn 'test + FnMut(Weight) -> Weight>>,
pre_upgrade_fn_callbacks: Vec<Box<dyn 'test + FnMut() -> Result<(), sp_runtime::DispatchError>>>,
post_upgrade_fn_callbacks: Vec<Box<dyn 'test + FnMut() -> Result<(), sp_runtime::DispatchError>>>,
pre_upgrade_fn_callbacks:
Vec<Box<dyn 'test + FnMut() -> Result<(), sp_runtime::DispatchError>>>,
post_upgrade_fn_callbacks:
Vec<Box<dyn 'test + FnMut() -> Result<(), sp_runtime::DispatchError>>>,
}

impl Default for MockMigrationManager<'_> {
Expand Down Expand Up @@ -207,12 +209,18 @@ impl<'test> MockMigrationManager<'test> {
}

#[cfg(feature = "try-runtime")]
pub(crate) fn invoke_pre_upgrade(&mut self, index: usize) -> Result<(), sp_runtime::DispatchError> {
pub(crate) fn invoke_pre_upgrade(
&mut self,
index: usize,
) -> Result<(), sp_runtime::DispatchError> {
self.pre_upgrade_fn_callbacks[index]()
}

#[cfg(feature = "try-runtime")]
pub(crate) fn invoke_post_upgrade(&mut self, index: usize) -> Result<(), sp_runtime::DispatchError> {
pub(crate) fn invoke_post_upgrade(
&mut self,
index: usize,
) -> Result<(), sp_runtime::DispatchError> {
self.post_upgrade_fn_callbacks[index]()
}

Expand Down

0 comments on commit 46bc6ea

Please sign in to comment.