git.delta.rocks / unique-network / refs/commits / 98c55c3ef587

difftreelog

feat remove rmrk leftovers migration

Yaroslav Bolyukin2023-02-15parent: #ae022a5.patch.diff
in: master

3 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
1074 packageslockfile v3
modifiedpallets/evm-migration/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-migration/Cargo.toml
+++ b/pallets/evm-migration/Cargo.toml
@@ -16,9 +16,10 @@
 scale-info = { workspace = true }
 sp-core = { workspace = true }
 sp-std = { workspace = true }
+sp-io = { workspace = true }
 
 [features]
 default = ["runtime-benchmarks", "std"]
 runtime-benchmarks = ["frame-benchmarking"]
-std = ["frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "sp-core/std", "sp-std/std"]
+std = ["frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "sp-core/std", "sp-std/std", "sp-io/std"]
 try-runtime = ["frame-support/try-runtime"]
modifiedpallets/evm-migration/src/lib.rsdiffbeforeafterboth
--- a/pallets/evm-migration/src/lib.rs
+++ b/pallets/evm-migration/src/lib.rs
@@ -149,6 +149,17 @@
 			}
 			Ok(())
 		}
+
+		/// Remove remark compatibility data leftovers
+		#[pallet::call_index(5)]
+		#[pallet::weight(<T as frame_system::Config>::DbWeight::get().reads_writes(10, 10))]
+		pub fn remove_rmrk_data(origin: OriginFor<T>) -> DispatchResult {
+			use sp_io::hashing::twox_128;
+			ensure_root(origin)?;
+			let _ = sp_io::storage::clear_prefix(&twox_128(b"RmrkEquip"), Some(5));
+			let _ = sp_io::storage::clear_prefix(&twox_128(b"RmrkCore"), Some(5));
+			Ok(())
+		}
 	}
 
 	/// Implements [`pallet_evm::OnMethodCall`], which reserves accounts with pending migration