From 5922742f5a6909c478f50a5c55ffecc106958477 Mon Sep 17 00:00:00 2001
From: bgallois <benjamin@gallois.cc>
Date: Thu, 8 Jun 2023 14:11:01 +0200
Subject: [PATCH] fix offences after rebase

---
 Cargo.lock                                    | 11 +--
 pallets/authority-members/src/lib.rs          |  1 +
 pallets/authority-members/src/weights.rs      |  2 +-
 pallets/offences/Cargo.toml                   | 16 ++--
 runtime/common/src/pallets_config.rs          |  2 +-
 .../src/weights/pallet_authority_members.rs   | 75 +++++++------------
 runtime/g1/Cargo.toml                         |  1 -
 runtime/gdev/Cargo.toml                       |  1 -
 runtime/gtest/Cargo.toml                      |  1 -
 9 files changed, 38 insertions(+), 72 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 602e676dd..f9769ef69 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5857,8 +5857,7 @@ dependencies = [
 
 [[package]]
 name = "pallet-offences"
-version = "4.0.0-dev"
-source = "git+https://github.com/duniter/substrate?branch=duniter-substrate-v0.9.42#c36ab4f32454318a47777b24b6533c44121fc10b"
+version = "3.0.0"
 dependencies = [
  "frame-support",
  "frame-system",
@@ -5867,17 +5866,9 @@ dependencies = [
  "parity-scale-codec",
  "scale-info",
  "serde",
-<<<<<<< HEAD
-<<<<<<< HEAD
  "sp-core",
  "sp-io",
  "sp-runtime",
-=======
- "sp-runtime 7.0.0",
->>>>>>> 78e6c4a (upgrade Cargo files)
-=======
- "sp-runtime",
->>>>>>> 8759555 (fix subxt dependency)
  "sp-staking",
  "sp-std 5.0.0",
 ]
diff --git a/pallets/authority-members/src/lib.rs b/pallets/authority-members/src/lib.rs
index 5eed64278..cbb599edd 100644
--- a/pallets/authority-members/src/lib.rs
+++ b/pallets/authority-members/src/lib.rs
@@ -361,6 +361,7 @@ pub mod pallet {
 
             Ok(().into())
         }
+        #[pallet::call_index(4)]
         #[pallet::weight(<T as pallet::Config>::WeightInfo::remove_member_from_blacklist())]
         /// remove an identity from the blacklist
         pub fn remove_member_from_blacklist(
diff --git a/pallets/authority-members/src/weights.rs b/pallets/authority-members/src/weights.rs
index 07badeab8..f4160f078 100644
--- a/pallets/authority-members/src/weights.rs
+++ b/pallets/authority-members/src/weights.rs
@@ -89,7 +89,7 @@ impl WeightInfo for () {
     // Storage: AuthorityMembers BlackList (r:1 w:1)
     fn remove_member_from_blacklist() -> Weight {
         // Minimum execution time: 60_023 nanoseconds.
-        Weight::from_ref_time(60_615_000 as u64)
+        Weight::from_parts(60_615_000 as u64, 0)
             .saturating_add(RocksDbWeight::get().reads(1 as u64))
             .saturating_add(RocksDbWeight::get().writes(1 as u64))
     }
diff --git a/pallets/offences/Cargo.toml b/pallets/offences/Cargo.toml
index 560b22f5b..d9c1ed86d 100644
--- a/pallets/offences/Cargo.toml
+++ b/pallets/offences/Cargo.toml
@@ -17,16 +17,16 @@ codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive
 log = { version = "0.4.17", default-features = false }
 scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
 serde = { version = "1.0.101", default-features = false, optional = true }
-frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-frame-system = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-sp-staking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-sp-std = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
+frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+frame-system = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+sp-staking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+sp-std = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 
 [dev-dependencies]
-sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
-sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
+sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
+sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' }
 
 [features]
 default = ["std"]
diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs
index 90bd74d23..19b9e8087 100644
--- a/runtime/common/src/pallets_config.rs
+++ b/runtime/common/src/pallets_config.rs
@@ -254,7 +254,7 @@ macro_rules! pallets_config {
                 <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
 
             type EquivocationReportSystem =
-            		pallet_babe::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
+            		pallet_grandpa::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
 
             type WeightInfo = common_runtime::weights::pallet_grandpa::WeightInfo<Runtime>;
 
diff --git a/runtime/common/src/weights/pallet_authority_members.rs b/runtime/common/src/weights/pallet_authority_members.rs
index c20ab7134..ca306d849 100644
--- a/runtime/common/src/weights/pallet_authority_members.rs
+++ b/runtime/common/src/weights/pallet_authority_members.rs
@@ -17,41 +17,25 @@
 //! Autogenerated weights for `pallet_authority_members`
 //!
 //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-<<<<<<< HEAD
-<<<<<<< HEAD
-//! DATE: 2023-05-13, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
-=======
-//! DATE: 2023-06-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
-=======
 //! DATE: 2023-06-08, STEPS: `5`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
->>>>>>> e43d36e (generate all weights)
 //! WORST CASE MAP SIZE: `1000000`
->>>>>>> c74eb74 (regenerate weights)
 //! HOSTNAME: `benjamin-xps139380`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz`
 //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("gdev-benchmark"), DB CACHE: 1024
 
 // Executed Command:
-// ./target/release/duniter
+// target/release/duniter
 // benchmark
 // pallet
 // --chain=gdev-benchmark
 // --steps=5
 // --repeat=2
-// --pallet=*
+// --pallet=pallet-authority-members
 // --extrinsic=*
 // --execution=wasm
 // --wasm-execution=compiled
-// --pallet
-// pallet-authority-members
-// --extrinsic
-// *
-// --steps
-// 50
-// --repeat
-// 20
-// --output=runtime/common/src/weights/
-// --header
-// file_header.txt
+// --heap-pages=4096
+// --header=./file_header.txt
+// --output=./runtime/common/src/weights/
 
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
@@ -82,8 +66,8 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf
 		// Proof Size summary in bytes:
 		//  Measured:  `632`
 		//  Estimated: `4097`
-		// Minimum execution time: 97_275_000 picoseconds.
-		Weight::from_parts(105_740_000, 0)
+		// Minimum execution time: 99_427_000 picoseconds.
+		Weight::from_parts(105_315_000, 0)
 			.saturating_add(Weight::from_parts(0, 4097))
 			.saturating_add(T::DbWeight::get().reads(7))
 			.saturating_add(T::DbWeight::get().writes(2))
@@ -92,6 +76,8 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf
 	/// Proof Skipped: Identity IdentityIndexOf (max_values: None, max_size: None, mode: Measured)
 	/// Storage: SmithMembership Membership (r:1 w:0)
 	/// Proof Skipped: SmithMembership Membership (max_values: None, max_size: None, mode: Measured)
+	/// Storage: AuthorityMembers BlackList (r:1 w:0)
+	/// Proof Skipped: AuthorityMembers BlackList (max_values: Some(1), max_size: None, mode: Measured)
 	/// Storage: AuthorityMembers Members (r:1 w:0)
 	/// Proof Skipped: AuthorityMembers Members (max_values: None, max_size: None, mode: Measured)
 	/// Storage: Session NextKeys (r:1 w:0)
@@ -108,10 +94,10 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf
 		// Proof Size summary in bytes:
 		//  Measured:  `1022`
 		//  Estimated: `4487`
-		// Minimum execution time: 117_748_000 picoseconds.
-		Weight::from_parts(125_139_000, 0)
+		// Minimum execution time: 120_665_000 picoseconds.
+		Weight::from_parts(130_931_000, 0)
 			.saturating_add(Weight::from_parts(0, 4487))
-			.saturating_add(T::DbWeight::get().reads(8))
+			.saturating_add(T::DbWeight::get().reads(9))
 			.saturating_add(T::DbWeight::get().writes(2))
 	}
 	/// Storage: Identity IdentityIndexOf (r:1 w:0)
@@ -131,21 +117,14 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf
 	/// Storage: AuthorityMembers MustRotateKeysBefore (r:1 w:1)
 	/// Proof Skipped: AuthorityMembers MustRotateKeysBefore (max_values: None, max_size: None, mode: Measured)
 	fn set_session_keys() -> Weight {
-<<<<<<< HEAD
-		// Minimum execution time: 161_156 nanoseconds.
-		Weight::from_ref_time(182_210_000 as u64)
-			.saturating_add(T::DbWeight::get().reads(11 as u64))
-			.saturating_add(T::DbWeight::get().writes(3 as u64))
-=======
 		// Proof Size summary in bytes:
 		//  Measured:  `1750`
 		//  Estimated: `12640`
-		// Minimum execution time: 163_550_000 picoseconds.
-		Weight::from_parts(186_074_000, 0)
+		// Minimum execution time: 166_507_000 picoseconds.
+		Weight::from_parts(181_777_000, 0)
 			.saturating_add(Weight::from_parts(0, 12640))
 			.saturating_add(T::DbWeight::get().reads(11))
 			.saturating_add(T::DbWeight::get().writes(3))
->>>>>>> c74eb74 (regenerate weights)
 	}
 	/// Storage: AuthorityMembers Members (r:1 w:1)
 	/// Proof Skipped: AuthorityMembers Members (max_values: None, max_size: None, mode: Measured)
@@ -170,27 +149,25 @@ impl<T: frame_system::Config> pallet_authority_members::WeightInfo for WeightInf
 	/// Storage: Session KeyOwner (r:0 w:4)
 	/// Proof Skipped: Session KeyOwner (max_values: None, max_size: None, mode: Measured)
 	fn remove_member() -> Weight {
-<<<<<<< HEAD
-		// Minimum execution time: 225_027 nanoseconds.
-		Weight::from_ref_time(243_550_000 as u64)
-			.saturating_add(T::DbWeight::get().reads(9 as u64))
-			.saturating_add(T::DbWeight::get().writes(13 as u64))
-=======
 		// Proof Size summary in bytes:
 		//  Measured:  `975`
 		//  Estimated: `4440`
-		// Minimum execution time: 219_385_000 picoseconds.
-		Weight::from_parts(230_204_000, 0)
+		// Minimum execution time: 222_719_000 picoseconds.
+		Weight::from_parts(240_189_000, 0)
 			.saturating_add(Weight::from_parts(0, 4440))
 			.saturating_add(T::DbWeight::get().reads(10))
 			.saturating_add(T::DbWeight::get().writes(14))
->>>>>>> c74eb74 (regenerate weights)
 	}
-	// Storage: AuthorityMembers BlackList (r:1 w:1)
+	/// Storage: AuthorityMembers BlackList (r:1 w:1)
+	/// Proof Skipped: AuthorityMembers BlackList (max_values: Some(1), max_size: None, mode: Measured)
 	fn remove_member_from_blacklist() -> Weight {
-		// Minimum execution time: 60_023 nanoseconds.
-		Weight::from_ref_time(60_615_000 as u64)
-			.saturating_add(T::DbWeight::get().reads(1 as u64))
-			.saturating_add(T::DbWeight::get().writes(1 as u64))
+		// Proof Size summary in bytes:
+		//  Measured:  `218`
+		//  Estimated: `1703`
+		// Minimum execution time: 41_963_000 picoseconds.
+		Weight::from_parts(47_577_000, 0)
+			.saturating_add(Weight::from_parts(0, 1703))
+			.saturating_add(T::DbWeight::get().reads(1))
+			.saturating_add(T::DbWeight::get().writes(1))
 	}
 }
diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml
index d6a6a2e4f..a8b9337a3 100644
--- a/runtime/g1/Cargo.toml
+++ b/runtime/g1/Cargo.toml
@@ -146,7 +146,6 @@ pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duni
 pallet-collective = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-im-online = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
-pallet-offences = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-multisig = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-preimage = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-proxy = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml
index 16fd2106a..8f51cf101 100644
--- a/runtime/gdev/Cargo.toml
+++ b/runtime/gdev/Cargo.toml
@@ -171,7 +171,6 @@ pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duni
 pallet-collective = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-im-online = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
-pallet-offences = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-multisig = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-preimage = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-proxy = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml
index 20490d392..c49e474fc 100644
--- a/runtime/gtest/Cargo.toml
+++ b/runtime/gtest/Cargo.toml
@@ -168,7 +168,6 @@ pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duni
 pallet-collective = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-im-online = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
-pallet-offences = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-multisig = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-preimage = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
 pallet-proxy = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
-- 
GitLab