mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
pallet-scheduler: Fix migrations V2 to V3 (#10757)
* pallet-scheduler: Fix migrations V2 to V3
V2 already supported origins, so we need to move them over instead of setting it to `Root`. Besides
that it also removes the custom `Releases` enum and moves it over to `StorageVersion`.
* Fixes
* Fixes
* 🤦
This commit is contained in:
@@ -21,7 +21,7 @@ use super::*;
|
||||
use crate::mock::{logger, new_test_ext, root, run_to_block, Call, LoggerCall, Scheduler, Test, *};
|
||||
use frame_support::{
|
||||
assert_err, assert_noop, assert_ok,
|
||||
traits::{Contains, OnInitialize, PreimageProvider},
|
||||
traits::{Contains, GetStorageVersion, OnInitialize, PreimageProvider},
|
||||
Hashable,
|
||||
};
|
||||
use sp_runtime::traits::Hash;
|
||||
@@ -707,9 +707,7 @@ fn migration_to_v3_works() {
|
||||
frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
|
||||
}
|
||||
|
||||
assert_eq!(StorageVersion::<Test>::get(), Releases::V1);
|
||||
|
||||
assert!(Scheduler::migrate_v1_to_v3());
|
||||
Scheduler::migrate_v1_to_v3();
|
||||
|
||||
assert_eq_uvec!(
|
||||
Agenda::<Test>::iter().collect::<Vec<_>>(),
|
||||
@@ -783,7 +781,7 @@ fn migration_to_v3_works() {
|
||||
]
|
||||
);
|
||||
|
||||
assert_eq!(StorageVersion::<Test>::get(), Releases::V3);
|
||||
assert_eq!(Scheduler::current_storage_version(), 3);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user