From 7ae006ce04db5507e0538a011009074df96caa64 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 16 Dec 2024 13:54:54 -0500 Subject: [PATCH] Add Slashing pallet to Registry mock --- Cargo.lock | 2 ++ pallets/registry/Cargo.toml | 1 + pallets/registry/src/mock.rs | 13 +++++++++++++ 3 files changed, 16 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c744db40c..f8fdfb7b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6768,6 +6768,7 @@ dependencies = [ "pallet-balances", "pallet-parameters", "pallet-session", + "pallet-slashing", "pallet-staking", "pallet-staking-extension", "pallet-staking-reward-curve", @@ -7354,6 +7355,7 @@ dependencies = [ "pallet-parameters", "pallet-programs", "pallet-session", + "pallet-slashing", "pallet-staking", "pallet-staking-extension", "pallet-staking-reward-curve", diff --git a/pallets/registry/Cargo.toml b/pallets/registry/Cargo.toml index 8c092beca..5c18cb335 100644 --- a/pallets/registry/Cargo.toml +++ b/pallets/registry/Cargo.toml @@ -46,6 +46,7 @@ sp-io ={ version="31.0.0", default-features=false } sp-npos-elections ={ version="27.0.0", default-features=false } sp-staking ={ version="27.0.0", default-features=false } pallet-oracle ={ version='0.3.0', path='../oracle', default-features=false } +pallet-slashing={ version="0.3.0", path="../slashing", default-features=false } [features] diff --git a/pallets/registry/src/mock.rs b/pallets/registry/src/mock.rs index 76054af22..573ea9e75 100644 --- a/pallets/registry/src/mock.rs +++ b/pallets/registry/src/mock.rs @@ -60,6 +60,7 @@ frame_support::construct_runtime!( Programs: pallet_programs, Parameters: pallet_parameters, Oracle: pallet_oracle, + Slashing: pallet_slashing, } ); @@ -380,6 +381,18 @@ impl pallet_parameters::Config for Test { type WeightInfo = (); } +parameter_types! { + pub const ReportThreshold: u32 = 5; +} + +impl pallet_slashing::Config for Test { + type RuntimeEvent = RuntimeEvent; + type AuthorityId = UintAuthorityId; + type ReportThreshold = ReportThreshold; + type ValidatorSet = Historical; + type ReportUnresponsiveness = (); +} + // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = system::GenesisConfig::::default().build_storage().unwrap();