Skip to content

Commit fdc136b

Browse files
authored
Merge pull request #938 from sander2/fix/sudo-migration
fix: properly remove key in the sudo migration
2 parents 217e08b + 3b1a8d7 commit fdc136b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

parachain/runtime/interlay/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,8 @@ struct SudoMigrationCheck;
12781278

12791279
impl OnRuntimeUpgrade for SudoMigrationCheck {
12801280
fn on_runtime_upgrade() -> Weight {
1281-
use frame_support::storage::migration::put_storage_value;
1282-
put_storage_value(b"Sudo", b"Key", &[], Option::<AccountId>::None);
1281+
use frame_support::storage::migration::take_storage_value;
1282+
take_storage_value::<AccountId>(b"Sudo", b"Key", &[]);
12831283
Default::default()
12841284
}
12851285
#[cfg(feature = "try-runtime")]

parachain/runtime/kintsugi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,8 +1272,8 @@ struct SudoMigrationCheck;
12721272

12731273
impl OnRuntimeUpgrade for SudoMigrationCheck {
12741274
fn on_runtime_upgrade() -> Weight {
1275-
use frame_support::storage::migration::put_storage_value;
1276-
put_storage_value(b"Sudo", b"Key", &[], Option::<AccountId>::None);
1275+
use frame_support::storage::migration::take_storage_value;
1276+
take_storage_value::<AccountId>(b"Sudo", b"Key", &[]);
12771277
Default::default()
12781278
}
12791279
#[cfg(feature = "try-runtime")]

standalone/runtime/tests/test_governance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,9 @@ fn test_sudo_is_disabled_if_key_is_none() {
940940
})
941941
.dispatch(origin_of(account_of(ALICE))),);
942942

943-
use frame_support::storage::migration::put_storage_value;
943+
use frame_support::storage::migration::take_storage_value;
944944
assert!(!pallet_sudo::Pallet::<Runtime>::key().is_none());
945-
put_storage_value(b"Sudo", b"Key", &[], Option::<AccountId>::None);
945+
take_storage_value::<AccountId>(b"Sudo", b"Key", &[]);
946946
assert!(pallet_sudo::Pallet::<Runtime>::key().is_none());
947947

948948
// assert that sudo does not work when key is none

0 commit comments

Comments
 (0)