git.delta.rocks / unique-network / refs/commits / 008833a7ebae

difftreelog

refactor(weight) bench rename `transfer` to `transfer_raw`

PraetorP2023-03-31parent: #c35b923.patch.diff
in: master

8 files changed

modifiedpallets/fungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/fungible/src/benchmarking.rs
+++ b/pallets/fungible/src/benchmarking.rs
@@ -66,7 +66,7 @@
 		<Pallet<T>>::create_item(&collection, &owner, (burner.clone(), 200), &Unlimited)?;
 	}: {<Pallet<T>>::burn(&collection, &burner, 100)?}
 
-	transfer {
+	transfer_raw {
 		bench_init!{
 			owner: sub; collection: collection(owner);
 			owner: cross_from_sub; sender: cross_sub; to: cross_sub;
modifiedpallets/fungible/src/common.rsdiffbeforeafterboth
--- a/pallets/fungible/src/common.rs
+++ b/pallets/fungible/src/common.rs
@@ -78,7 +78,7 @@
 	}
 
 	fn transfer() -> Weight {
-		<SelfWeightOf<T>>::transfer() + <PalletCommonWeightOf<T>>::check_accesslist() * 2
+		<SelfWeightOf<T>>::transfer_raw() + <PalletCommonWeightOf<T>>::check_accesslist() * 2
 	}
 
 	fn approve() -> Weight {
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -400,7 +400,7 @@
 			<CommonError<T>>::TransferNotAllowed,
 		);
 
-		let mut actual_weight = <SelfWeightOf<T>>::transfer();
+		let mut actual_weight = <SelfWeightOf<T>>::transfer_raw();
 
 		if collection.permissions.access() == AccessMode::AllowList {
 			collection.check_allowlist(from)?;
modifiedpallets/fungible/src/weights.rsdiffbeforeafterboth
37 fn create_item() -> Weight;37 fn create_item() -> Weight;
38 fn create_multiple_items_ex(b: u32, ) -> Weight;38 fn create_multiple_items_ex(b: u32, ) -> Weight;
39 fn burn_item() -> Weight;39 fn burn_item() -> Weight;
40 fn transfer() -> Weight;40 fn transfer_raw() -> Weight;
41 fn approve() -> Weight;41 fn approve() -> Weight;
42 fn approve_from() -> Weight;42 fn approve_from() -> Weight;
43 fn check_allowed_raw() -> Weight;43 fn check_allowed_raw() -> Weight;
93 .saturating_add(T::DbWeight::get().reads(2_u64))93 .saturating_add(T::DbWeight::get().reads(2_u64))
94 .saturating_add(T::DbWeight::get().writes(2_u64))94 .saturating_add(T::DbWeight::get().writes(2_u64))
95 }95 }
96 /// Storage: Fungible Balance (r:2 w:2)96 // Storage: Fungible Balance (r:2 w:2)
97 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)
98 fn transfer() -> Weight {97 fn transfer_raw() -> Weight {
99 // Proof Size summary in bytes:
100 // Measured: `182`
101 // Estimated: `5104`
102 // Minimum execution time: 13_832_000 picoseconds.
103 Weight::from_parts(14_064_000, 5104)98 Weight::from_ref_time(12_041_000 as u64)
104 .saturating_add(T::DbWeight::get().reads(2_u64))99 .saturating_add(T::DbWeight::get().reads(2 as u64))
105 .saturating_add(T::DbWeight::get().writes(2_u64))100 .saturating_add(T::DbWeight::get().writes(2 as u64))
106 }101 }
107 /// Storage: Fungible Balance (r:1 w:0)102 /// Storage: Fungible Balance (r:1 w:0)
108 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)103 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)
205 .saturating_add(RocksDbWeight::get().reads(2_u64))200 .saturating_add(RocksDbWeight::get().reads(2_u64))
206 .saturating_add(RocksDbWeight::get().writes(2_u64))201 .saturating_add(RocksDbWeight::get().writes(2_u64))
207 }202 }
208 /// Storage: Fungible Balance (r:2 w:2)203 // Storage: Fungible Balance (r:2 w:2)
209 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)
210 fn transfer() -> Weight {204 fn transfer_raw() -> Weight {
211 // Proof Size summary in bytes:
212 // Measured: `182`
213 // Estimated: `5104`
214 // Minimum execution time: 13_832_000 picoseconds.
215 Weight::from_parts(14_064_000, 5104)205 Weight::from_ref_time(12_041_000 as u64)
216 .saturating_add(RocksDbWeight::get().reads(2_u64))206 .saturating_add(RocksDbWeight::get().reads(2 as u64))
217 .saturating_add(RocksDbWeight::get().writes(2_u64))207 .saturating_add(RocksDbWeight::get().writes(2 as u64))
218 }208 }
219 /// Storage: Fungible Balance (r:1 w:0)209 /// Storage: Fungible Balance (r:1 w:0)
220 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)210 /// Proof: Fungible Balance (max_values: None, max_size: Some(77), added: 2552, mode: MaxEncodedLen)
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -121,7 +121,7 @@
 		}
 	}: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}
 
-	transfer {
+	transfer_raw {
 		bench_init!{
 			owner: sub; collection: collection(owner);
 			owner: cross_from_sub; sender: cross_sub; receiver: cross_sub;
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -91,7 +91,7 @@
 	}
 
 	fn transfer() -> Weight {
-		<SelfWeightOf<T>>::transfer() + <PalletCommonWeightOf<T>>::check_accesslist() * 2
+		<SelfWeightOf<T>>::transfer_raw() + <PalletCommonWeightOf<T>>::check_accesslist() * 2
 	}
 
 	fn approve() -> Weight {
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -809,7 +809,7 @@
 			<CommonError<T>>::TransferNotAllowed
 		);
 
-		let mut actual_weight = <SelfWeightOf<T>>::transfer();
+		let mut actual_weight = <SelfWeightOf<T>>::transfer_raw();
 		let token_data =
 			<TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;
 		ensure!(&token_data.owner == from, <CommonError<T>>::NoPermission);
modifiedpallets/nonfungible/src/weights.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/weights.rs
+++ b/pallets/nonfungible/src/weights.rs
@@ -40,7 +40,7 @@
 	fn burn_item() -> Weight;
 	fn burn_recursively_self_raw() -> Weight;
 	fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight;
-	fn transfer() -> Weight;
+	fn transfer_raw() -> Weight;
 	fn approve() -> Weight;
 	fn approve_from() -> Weight;
 	fn checks_allowed_raw() -> Weight;
@@ -209,22 +209,14 @@
 			.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(b.into())))
 			.saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into()))
 	}
-	/// Storage: Nonfungible TokenData (r:1 w:1)
-	/// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
-	/// Storage: Nonfungible AccountBalance (r:2 w:2)
-	/// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
-	/// Storage: Nonfungible Allowance (r:1 w:0)
-	/// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
-	/// Storage: Nonfungible Owned (r:0 w:2)
-	/// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen)
-	fn transfer() -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `412`
-		//  Estimated: `10144`
-		// Minimum execution time: 18_629_000 picoseconds.
-		Weight::from_parts(18_997_000, 10144)
-			.saturating_add(T::DbWeight::get().reads(4_u64))
-			.saturating_add(T::DbWeight::get().writes(5_u64))
+	// Storage: Nonfungible TokenData (r:1 w:1)
+	// Storage: Nonfungible AccountBalance (r:2 w:2)
+	// Storage: Nonfungible Allowance (r:1 w:0)
+	// Storage: Nonfungible Owned (r:0 w:2)
+	fn transfer_raw() -> Weight {
+		Weight::from_ref_time(14_909_000 as u64)
+			.saturating_add(T::DbWeight::get().reads(4 as u64))
+			.saturating_add(T::DbWeight::get().writes(5 as u64))
 	}
 	/// Storage: Nonfungible TokenData (r:1 w:0)
 	/// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
@@ -523,22 +515,14 @@
 			.saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(b.into())))
 			.saturating_add(Weight::from_parts(0, 10097).saturating_mul(b.into()))
 	}
-	/// Storage: Nonfungible TokenData (r:1 w:1)
-	/// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
-	/// Storage: Nonfungible AccountBalance (r:2 w:2)
-	/// Proof: Nonfungible AccountBalance (max_values: None, max_size: Some(65), added: 2540, mode: MaxEncodedLen)
-	/// Storage: Nonfungible Allowance (r:1 w:0)
-	/// Proof: Nonfungible Allowance (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)
-	/// Storage: Nonfungible Owned (r:0 w:2)
-	/// Proof: Nonfungible Owned (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen)
-	fn transfer() -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `412`
-		//  Estimated: `10144`
-		// Minimum execution time: 18_629_000 picoseconds.
-		Weight::from_parts(18_997_000, 10144)
-			.saturating_add(RocksDbWeight::get().reads(4_u64))
-			.saturating_add(RocksDbWeight::get().writes(5_u64))
+	// Storage: Nonfungible TokenData (r:1 w:1)
+	// Storage: Nonfungible AccountBalance (r:2 w:2)
+	// Storage: Nonfungible Allowance (r:1 w:0)
+	// Storage: Nonfungible Owned (r:0 w:2)
+	fn transfer_raw() -> Weight {
+		Weight::from_ref_time(14_909_000 as u64)
+			.saturating_add(RocksDbWeight::get().reads(4 as u64))
+			.saturating_add(RocksDbWeight::get().writes(5 as u64))
 	}
 	/// Storage: Nonfungible TokenData (r:1 w:0)
 	/// Proof: Nonfungible TokenData (max_values: None, max_size: Some(57), added: 2532, mode: MaxEncodedLen)