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

Commit

Permalink
rename migration
Browse files Browse the repository at this point in the history
  • Loading branch information
liamaharon committed Jun 4, 2023
1 parent 6e9d9a4 commit 7b51e6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frame/tips/src/migrations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
pub mod v4;

/// A migration that unreserves all funds held in the context of this pallet.
pub mod unreserve_all_funds;
pub mod unreserve_deposits;
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use sp_std::vec::Vec;
/// The pallet should be made inoperable before or immediately after this migration is run.
///
/// (See also the `RemovePallet` migration in `frame/support/src/migrations.rs`)
pub struct UnreserveAllFunds<T: crate::Config<I>, I: 'static>(sp_std::marker::PhantomData<(T, I)>);
pub struct UnreserveDeposits<T: crate::Config<I>, I: 'static>(sp_std::marker::PhantomData<(T, I)>);

impl<T: crate::Config<I>, I: 'static> UnreserveAllFunds<T, I> {
impl<T: crate::Config<I>, I: 'static> UnreserveDeposits<T, I> {
/// Calculates and returns the total amount reserved by each account by this pallet from open
/// tips.
///
Expand Down Expand Up @@ -64,7 +64,7 @@ impl<T: crate::Config<I>, I: 'static> UnreserveAllFunds<T, I> {
}
}

impl<T: crate::Config<I>, I: 'static> OnRuntimeUpgrade for UnreserveAllFunds<T, I>
impl<T: crate::Config<I>, I: 'static> OnRuntimeUpgrade for UnreserveDeposits<T, I>
where
BalanceOf<T, I>: Sum,
{
Expand Down Expand Up @@ -179,7 +179,7 @@ where
mod test {
use super::*;
use crate::{
migrations::unreserve_all_funds::UnreserveAllFunds,
migrations::unreserve_deposits::UnreserveDeposits,
tests::{new_test_ext, RuntimeOrigin, Test, Tips},
};
use frame_support::{assert_ok, traits::TypedGet};
Expand Down Expand Up @@ -233,12 +233,12 @@ mod test {
);

// Execute the migration
let bytes = match UnreserveAllFunds::<Test, ()>::pre_upgrade() {
let bytes = match UnreserveDeposits::<Test, ()>::pre_upgrade() {
Ok(bytes) => bytes,
Err(e) => panic!("pre_upgrade failed: {:?}", e),
};
UnreserveAllFunds::<Test, ()>::on_runtime_upgrade();
assert_ok!(UnreserveAllFunds::<Test, ()>::post_upgrade(bytes));
UnreserveDeposits::<Test, ()>::on_runtime_upgrade();
assert_ok!(UnreserveDeposits::<Test, ()>::post_upgrade(bytes));

// Check the deposits were were unreserved
assert_eq!(
Expand Down

0 comments on commit 7b51e6b

Please sign in to comment.