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

Commit

Permalink
restrict is_upgrade_supported
Browse files Browse the repository at this point in the history
  • Loading branch information
juangirini committed Jun 6, 2023
1 parent 2601d79 commit e88854a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frame/contracts/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub trait MigrateSequence: private::Sealed {
return false
};

in_storage >= first_supported && target == high
in_storage == first_supported && target == high
}
}

Expand Down Expand Up @@ -513,7 +513,7 @@ mod test {
fn is_upgrade_supported_works() {
type Migrations = (MockMigration<9>, MockMigration<10>, MockMigration<11>);

[(1, 1), (8, 11), (9, 11)].into_iter().for_each(|(from, to)| {
[(1, 1), (8, 11)].into_iter().for_each(|(from, to)| {
assert!(
Migrations::is_upgrade_supported(
StorageVersion::new(from),
Expand All @@ -525,7 +525,7 @@ mod test {
)
});

[(1, 0), (0, 3), (7, 11), (8, 10)].into_iter().for_each(|(from, to)| {
[(1, 0), (0, 3), (7, 11), (8, 10), (9, 11)].into_iter().for_each(|(from, to)| {
assert!(
!Migrations::is_upgrade_supported(
StorageVersion::new(from),
Expand Down

0 comments on commit e88854a

Please sign in to comment.