Skip to content

Commit

Permalink
Add Slashing pallet to Registry mock
Browse files Browse the repository at this point in the history
  • Loading branch information
HCastano committed Dec 16, 2024
1 parent 1b92f1c commit 7ae006c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pallets/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
13 changes: 13 additions & 0 deletions pallets/registry/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ frame_support::construct_runtime!(
Programs: pallet_programs,
Parameters: pallet_parameters,
Oracle: pallet_oracle,
Slashing: pallet_slashing,
}
);

Expand Down Expand Up @@ -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::<Test>::default().build_storage().unwrap();
Expand Down

0 comments on commit 7ae006c

Please sign in to comment.