Skip to content

Commit

Permalink
ensure migration idempotency
Browse files Browse the repository at this point in the history
  • Loading branch information
renauter committed Sep 2, 2024
1 parent b876984 commit e26cd25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions substrate-node/pallets/pallet-tft-bridge/src/migrations/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
info!("current pallet version: {:?}", PalletVersion::<T>::get());
ensure!(
PalletVersion::<T>::get() == types::StorageVersion::V1,
PalletVersion::<T>::get() >= types::StorageVersion::V1,
DispatchError::Other("Unexpected pallet version")
);

Expand All @@ -36,7 +36,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
executed_burn_transactions_count
);

info!("👥 TFT-BRIDGE pallet to V1 passes PRE migrate checks ✅",);
info!("👥 TFT-BRIDGE pallet to V2 passes PRE migrate checks ✅",);
Ok(Vec::<u8>::new())
}

Expand All @@ -55,7 +55,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateBurnTransactionsV2<T> {
) -> Result<(), sp_runtime::TryRuntimeError> {
info!("current pallet version: {:?}", PalletVersion::<T>::get());
ensure!(
PalletVersion::<T>::get() == types::StorageVersion::V2,
PalletVersion::<T>::get() >= types::StorageVersion::V2,
DispatchError::Other("Unexpected pallet version")
);

Expand Down

0 comments on commit e26cd25

Please sign in to comment.