git.delta.rocks / unique-network / refs/commits / b0b5098b9e8b

difftreelog

fix(rmrk) use derivative for enum defaults

Daniel Shiposha2022-06-02parent: #4b3d058.patch.diff
in: master

3 files changed

modifiedCargo.lockdiffbeforeafterboth
6329name = "pallet-rmrk-core"6329name = "pallet-rmrk-core"
6330version = "0.1.0"6330version = "0.1.0"
6331dependencies = [6331dependencies = [
6332 "derivative",
6332 "frame-benchmarking",6333 "frame-benchmarking",
6333 "frame-support",6334 "frame-support",
6334 "frame-system",6335 "frame-system",
modifiedpallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/Cargo.toml
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -23,6 +23,7 @@
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.22" }
 frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
 scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+derivative = { version = "2.2.0", features = ["use_core"] }
 
 [features]
 default = ["std"]
modifiedpallets/proxy-rmrk-core/src/misc.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/misc.rs
+++ b/pallets/proxy-rmrk-core/src/misc.rs
@@ -1,5 +1,6 @@
 use super::*;
 use codec::{Encode, Decode};
+use derivative::Derivative;
 
 #[macro_export]
 macro_rules! map_common_err_to_proxy {
@@ -49,9 +50,10 @@
 }
 
 // todo remove default?
-#[derive(Encode, Decode, PartialEq, Eq, Default)]
+#[derive(Encode, Decode, PartialEq, Eq, Derivative)]
+#[derivative(Default(bound=""))]
 pub enum NftType {
-	#[default]
+	#[derivative(Default)]
 	Regular,
 	Resource,
 	FixedPart,
@@ -60,9 +62,10 @@
 }
 
 // todo remove default?
-#[derive(Encode, Decode, PartialEq, Eq, Default)]
+#[derive(Encode, Decode, PartialEq, Eq, Derivative)]
+#[derivative(Default(bound=""))]
 pub enum ResourceType {
-	#[default]
+	#[derivative(Default)]
 	Basic,
 	Composable,
 	Slot,