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
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6272,6 +6272,7 @@
  "parity-scale-codec",
  "scale-info",
  "sp-core",
+ "sp-io",
  "sp-std",
 ]
 
modifiedpallets/evm-migration/Cargo.tomldiffbeforeafterboth
before · pallets/evm-migration/Cargo.toml
1[package]2edition = "2021"3license = "GPLv3"4name = "pallet-evm-migration"5version = "0.1.1"67[dependencies]8# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.9codec = { workspace = true, package = "parity-scale-codec" }1011ethereum = { workspace = true }12frame-benchmarking = { workspace = true, optional = true }13frame-support = { workspace = true }14frame-system = { workspace = true }15pallet-evm = { workspace = true }16scale-info = { workspace = true }17sp-core = { workspace = true }18sp-std = { workspace = true }1920[features]21default = ["runtime-benchmarks", "std"]22runtime-benchmarks = ["frame-benchmarking"]23std = ["frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "sp-core/std", "sp-std/std"]24try-runtime = ["frame-support/try-runtime"]
after · pallets/evm-migration/Cargo.toml
1[package]2edition = "2021"3license = "GPLv3"4name = "pallet-evm-migration"5version = "0.1.1"67[dependencies]8# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.9codec = { workspace = true, package = "parity-scale-codec" }1011ethereum = { workspace = true }12frame-benchmarking = { workspace = true, optional = true }13frame-support = { workspace = true }14frame-system = { workspace = true }15pallet-evm = { workspace = true }16scale-info = { workspace = true }17sp-core = { workspace = true }18sp-std = { workspace = true }19sp-io = { workspace = true }2021[features]22default = ["runtime-benchmarks", "std"]23runtime-benchmarks = ["frame-benchmarking"]24std = ["frame-benchmarking/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "sp-core/std", "sp-std/std", "sp-io/std"]25try-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