Skip to content

Commit

Permalink
Safeguard test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Feb 7, 2024
1 parent 72fa2ee commit c530b05
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pallets/dapp-staking-v3/src/test/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
use crate::test::{mock::*, testing_utils::*};
use crate::{
pallet::Config, ActiveProtocolState, DAppId, EraRewards, Error, Event, ForcingType,
IntegratedDApps, Ledger, NextDAppId, PeriodNumber, StakerInfo, Subperiod, TierConfig,
IntegratedDApps, Ledger, NextDAppId, PeriodNumber, Safeguard, StakerInfo, Subperiod,
TierConfig,
};

use frame_support::{
Expand Down Expand Up @@ -2312,6 +2313,17 @@ fn force_with_incorrect_origin_fails() {
})
}

#[test]
fn force_with_safeguard_on_fails() {
ExtBuilder::build().execute_with(|| {
Safeguard::<Test>::put(true);
assert_noop!(
DappStaking::force(RuntimeOrigin::root(), ForcingType::Era),
Error::<Test>::ForceNotAllowed
);
})
}

#[test]
fn get_dapp_tier_assignment_and_rewards_basic_example_works() {
ExtBuilder::build().execute_with(|| {
Expand Down

0 comments on commit c530b05

Please sign in to comment.