Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Aug 28, 2024
1 parent 8edf952 commit 1730efb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Binary file modified crates/client/entropy_metadata.scale
Binary file not shown.
12 changes: 6 additions & 6 deletions pallets/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ pub mod pallet {
.or(Err(Error::<T>::InvalidValidatorId))?;

let signers = Self::signers();
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbodingWhenSigner);
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbondingWhenSigner);

let next_signers = Self::next_signers();
if next_signers.is_some() {
Expand All @@ -424,7 +424,7 @@ pub mod pallet {
.ok_or(Error::<T>::ReshareNotInProgress)?
.next_signers
.contains(&validator_id),
Error::<T>::NoUnbodingWhenNextSigner
Error::<T>::NoUnbondingWhenNextSigner
);
}

Expand All @@ -446,7 +446,7 @@ pub mod pallet {
.or(Err(Error::<T>::InvalidValidatorId))?;

let signers = Self::signers();
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbodingWhenSigner);
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbondingWhenSigner);

let next_signers = Self::next_signers();
if next_signers.is_some() {
Expand All @@ -455,7 +455,7 @@ pub mod pallet {
.ok_or(Error::<T>::ReshareNotInProgress)?
.next_signers
.contains(&validator_id),
Error::<T>::NoUnbodingWhenNextSigner
Error::<T>::NoUnbondingWhenNextSigner
);
}

Expand All @@ -480,15 +480,15 @@ pub mod pallet {
.or(Err(Error::<T>::InvalidValidatorId))?;

let signers = Self::signers();
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbodingWhenSigner);
ensure!(!signers.contains(&validator_id), Error::<T>::NoUnbondingWhenSigner);
let next_signers = Self::next_signers();
if next_signers.is_some() {
ensure!(
!next_signers
.ok_or(Error::<T>::ReshareNotInProgress)?
.next_signers
.contains(&validator_id),
Error::<T>::NoUnbodingWhenNextSigner
Error::<T>::NoUnbondingWhenNextSigner
);
}

Expand Down
12 changes: 6 additions & 6 deletions pallets/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ fn it_deletes_when_no_bond_left() {

assert_noop!(
Staking::withdraw_unbonded(RuntimeOrigin::signed(7), 0),
Error::<Test>::NoUnbodingWhenSigner
Error::<Test>::NoUnbondingWhenSigner
);

assert_ok!(FrameStaking::bond(
Expand All @@ -333,7 +333,7 @@ fn it_deletes_when_no_bond_left() {

assert_noop!(
Staking::withdraw_unbonded(RuntimeOrigin::signed(8), 0),
Error::<Test>::NoUnbodingWhenNextSigner
Error::<Test>::NoUnbondingWhenNextSigner
);
});
}
Expand Down Expand Up @@ -498,7 +498,7 @@ fn it_stops_unbonded_when_signer_or_next_signer() {

assert_noop!(
Staking::unbond(RuntimeOrigin::signed(7), 0),
Error::<Test>::NoUnbodingWhenSigner
Error::<Test>::NoUnbondingWhenSigner
);

assert_ok!(FrameStaking::bond(
Expand All @@ -510,7 +510,7 @@ fn it_stops_unbonded_when_signer_or_next_signer() {
NextSigners::<Test>::put(NextSignerInfo { next_signers: vec![8], confirmations: vec![] });
assert_noop!(
Staking::unbond(RuntimeOrigin::signed(8), 0),
Error::<Test>::NoUnbodingWhenNextSigner
Error::<Test>::NoUnbondingWhenNextSigner
);
});
}
Expand All @@ -527,7 +527,7 @@ fn it_stops_chill_when_signer_or_next_signer() {
pallet_staking::RewardDestination::Account(1),
));

assert_noop!(Staking::chill(RuntimeOrigin::signed(7)), Error::<Test>::NoUnbodingWhenSigner);
assert_noop!(Staking::chill(RuntimeOrigin::signed(7)), Error::<Test>::NoUnbondingWhenSigner);

assert_ok!(FrameStaking::bond(
RuntimeOrigin::signed(8),
Expand All @@ -539,7 +539,7 @@ fn it_stops_chill_when_signer_or_next_signer() {

assert_noop!(
Staking::chill(RuntimeOrigin::signed(8)),
Error::<Test>::NoUnbodingWhenNextSigner
Error::<Test>::NoUnbondingWhenNextSigner
);
});
}

0 comments on commit 1730efb

Please sign in to comment.